Hey guys,
So I’ve been testing out some 2D features in Unity as I’m aiming to create a 2D game. So far, it’s wonderful - my last 2D endeavor entailed hand-coding my sprite animation…not fun.
I am relying heavily on physics & 2D rigidbodies in this. My main character is moved using AddForce(). Since I want my character to have a pretty quick jump/land, I have gravity set to -100 (instead of the standard -9.81). The intense gravity setting was done as per suggestion from the actual Unity 2D tutorial video, and I like the response it gives me; however, I’ve run into a problem.
Problem:
With rigidbodies that contain bouncy materials, the intense gravity causes them to bounce/jitter indefinitely when they should be asleep.
I have a circle collider with rigidbody properties tweaked so it behaves how I like it, with bounciness: 0.5 and friction: 1. The physics properties of the ground are friction: 1 and bounciness: 0. I’ve concluded that the intense gravity and the level of bounciness cause the object to have an indefinite bounce, but I cannot find a way to overcome it!
Here’s what I’ve tried:
- Increase linear drag on bouncing object - stops bouncing, but also doesn’t allow the object to move much/at all.
- Change mass on bouncing object - nope. Nothing.
- Change gravity scale on bouncing object - obvious solution to jitter problem, but then this object behaves as it would on the moon while everything else behaves normally, resulting in non-uniform gravity.
- Change bounciness - then it doesn’t behave how I’d like it to!
- Alter Interpolate settings, Sleep Mode settings, Collision Detection settings…no luck
- Decrease Physics/Physics2D settings for gravity - then I lose the quick jump that I like.
- Alter physics properties of the surfaces it bounces on - nah.
After a few days of trying every possible combination of these things, I can’t seem to get it straight. I’m at a loss for ideas, Unity community…and I need your help!
I’ve included a link to the video below. If you don’t have any suggestions, then I hope you’ll at least enjoy my cat! :-3
Video: Video Here