Search code examples
unity-game-enginegame-physicsgameobjectrigid-bodies

Unity2D GameObject Falling While Gravity Scale Set to 0


I'm programming a top-down 2D game where the background is the ground. Every time I test the game, my character falls down to the lower bound of the map. Everywhere I look, people are saying that setting "Gravity Scale" to 0 will prevent this downward pull, but even with that value in place, my character falls upon playtesting.

I've attached a screenshot of the Rigidbody 2D settings for my character below.

enter image description here


Solution

  • The character's projectile has its own Circle Collider, meant to be used as a trigger. This however was not set, and, while the projectile was not showing, it was still colliding (as I had not set it as disabled during the animation). This meant that it would collide with the player's main Box Collider, and push it downward.