Jumping in slowmotion

Hi!
A question about 2D physics.
I’m trying to make a good 2D-sidesscrolling controller. I want to utilize slow-motion in my project.

In the image bellow you can se my problem. The blue border is supposed to be the apex of a jump. But when the game runs in slow-motion it over-shoots it a small lenght.

What am I missing? :slight_smile:

try modifying the velocity. add a * Time.deltaTime to rb2D.velocity.x and if thats not good enough, make a speed variable and add * speed as well

1 Like

Thank you very much for the answer. But the “rb2D.velocity.x” is not the problem here. It’s just there to zero out the velocity in Y so the jump is not affected by the current velocity in y. So the jump is always the same force/height. But thanks anyways! :slight_smile:

well id like to try and help you more. are you trying to make a slowmotion happen automatically or when the player presses a button or key?

1 Like

If you can get this to look OK without changing the fixedDeltaTime, I suspect the physics will be more consistent. There are a couple of useful threads to read, one analysis of scaled time by @Edy and I think a couple by me looking at the implications of semi-implicit euler integration and small displacement errors. I’ll try and edit this later with links… Sorry on phone atm.

Edit: Links

2 Likes

It will go in to slowmotion when the player is in the air and is about to fire an arrow from a bow. A little like in Breath Of The Wild

Thanks! It actually works if I don’t alter the fixedDeltaTime, but it stutters, but if I’m using “interpolate” on the player it looks and works great. But I’m afraid of that this will slowdown the game when it scales to a lot of characters.

1 Like

According to this recent post Any other approaches to avoiding uneven motion when using Interpolate on main camera? interpolate is the way to go and cost is very low.

2 Likes

Ok! I appreciate you taking the time! I’ll do it that way!! :slight_smile:

1 Like