Jordan Durci
Jordan Durci

Reputation: 43

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

Upvotes: 0

Views: 1846

Answers (1)

Jordan Durci
Jordan Durci

Reputation: 43

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.

Upvotes: 2

Related Questions