I am having a problem in my game for the last few days I have been working towards this with a wall-climbing, jumping system for my 2D game. I made a quick wall sprite that I could jump towards, grab on (well the sprite is supposed to grab on when the sprite animation is working) and move off an then jump towards whatever. Everything was working with the single sprite:
Could climb up and jump off both sides of the “wall”
So, I set up a second sprite (duplicated and then brought in via child scene, same result) to see if I could jump from one to the other and then correct the inevitable problems that are going to crop up, when something strange happened, the movement to the right stopped right where the boundary of the second sprite started, and I can’t think of a single reason why that occurred. Not a one .
Have you tried testing with “Visible Collision Shapes” on in the top-left debug menu? Using a RigidBody2D means the wall’s stopping collision will be affected by gravity and other forces, it is very likely it simply fell down. Since the sprites are not children of the RigidBody you do not see this change visually.
if you want it to stay put, use a StaticBody2D
if you want control, a CharacterBody2D
if you want animation like a moving platform, a AnimatableBody2D
if you want to give in the whims of physics, a RigidBody2D
That was it! It fell down, well, I wasn’t expecting that behaviour at all.
Just added it back it to see and the the rigidbody 2D is now placed next to the wall, that is next to the staticbody2D .
Thanks for the reply - I made the wall scene about a month ago and made some major changes to the game since then and the rigidbody was the first thing I came up with when I created it. Will remember to check with Collision Shapes in the future. All good now!