In my top-down, 2D spaceship game, I'm trying to teleport the player into the pilot's seat when the player interacts with it. I'm using a staticbody2d for the pilot seat and then when the player interacts with it, it turns the player's collision mask off and moves the player to the pilot seat's position. I'm having issues with my state machine registering when the player is interacting with that object and the player's not teleporting to the exact position that I expected, so I'm still working through figuring out what's going on there, but I can't help but feel the approach I'm taking is kinda stupid. Before I spend too much time on this, is there a better way to handle this?
#2D Top-down game: teleport Player inside StaticBody2D
1 messages · Page 1 of 1 (latest)
It may be simpler to take the sprite of the character and plop it into the seat part. Maybe even just let the ship have its own sprite of the player and just show/hide it as needed.
Meanwhile the player can even be removed from the scene.
Hadn't thought of something that simple. I may have been over-engineering.
Only thing I'm thinking now, is if the player can customize their appearance, then the occupied seat sprite would have to match as well..
You can take the texture from the player's sprite and give it to the ship's sprite.
Or even duplicate the character's Sprite2D node.
I used that approach for an after-image mechanic once. Bit overkill but it is simple.