Hello, my rigidbody2d is not reacting correctly to the applied gravityscale.
What i wanted to achieve was to apply gravity for a short time to a rigidbody2d. Sadly it somehow goes into the full wrong direction. Iam using Unity2019.4.40f1
while there are 3 different behaviors without changing any setting.
What iam doing is setting the rb2d gravity scale to 80. The project has a gravity of (0.0, -9,81). Normally the gravityscale is 0.
- When i run into the pit without doing anything before. The player gets sucked into a positive Y Value.
- When i open the prefab of the player in the editor, it tries to go up but then the player keeps falling.
- When i open the player instance in the scene, the rigidbody acts normally.
playerCore.rb2d.gravityScale = 80; When animation starts
playerCore.rb2d.gravityScale = 0; When animation ends.
Maybe iam missing something?
Oh yes i was missing something. Turning off “Apply root motion” for the duration of the fall brings the right behavior.
but honestly this rootmotion thing is making so many things super hard. I guess i dont fully understand what its needed for, i just need it in some animations.
Thank you for your time, the thread can be closed