How do I make a portal like half body is on the one side other half is on the other side
Easy way is adding the animation to the portal Sprite, so when:
Player collides with the portal init
Set player to Hide.
Play the portal init animation with a left half of the player in it.
Play the portal destination animation with a right half of the player in it.
Then when the portal destination animation finish. move the player to the portal destination and set player to Show
The easiest way would be to use 2 tiled sprite objects with the players image.
Then you only need to create 2 them on the portals position and change it’s width according to the x position of portal and player. The second one needs to be created with a negative width.
nvm, i forgot that you cannot have animations for tiled sprites, so this method would only work well, if you have 1 frame prictures, like the platformer example jump.
so a better way might be to just put a sprite over the player to hide the corresponding side of a portal, and use layer changes, or z-oder chenanigans to have the player hide behind it, if he is in collusion with portal.
i make little example of a 1-sided portal.