So i’m working on an endless runner very similar to subway surfers, and i’m having an issue in understanding how I can make the jump stay consistent as the speed increases. So for an example, if their are coin arcs to collect when jumping, the players jump will stay consistent to that arch no matter how fast the player is going
Thanks in advance!
More detailed explanation:
As the speed increases, the player will seem to linger in the air longer. The obvious method is to just increase gravity, but if i do that i would also have to change the jump force to get the same height, and it can become a little messy to slowly increase these values as the speed increases, while keeping the jump height exactly the same.
Is there a way to have a specific distance and height for the jump, and then calculate how much air time the player will have based on the speed. That way the player will have the exact same arc no matter how fast he is moving.
Do you want your jump shorter if you are moving faster? If yes you can apply more gravity the faster you are moving.
Anyway I dont know subway surfers but I watched some videos on youtube and the coins are magnetic, you dont have to lineup jumps perfectly to collect them in that game
Yes, i want the jump to land quicker the faster the player is running. I know i can increase gravity, but I was wondering if there was some way to check where the player is supposed to land based on the speed. And then create a jump arc that will always have the same height, but the air time changes based on speed. Because if i change gravity, then i also have to change jump force, and then it becomes a little messy.
Anyone have any luck finding a solution to this? I’m running into the same problem. I can’t use TimeScale as other objects in the scene will break if TimeScale increases. But, I need the duration of my jump to remain consistent as the level speeds up. Meaning, the jump doesn’t cause the player to traverse further distances than previously
Currently using a simple Rigidbody Addforce for the jump, played around with using custom gravity scales (given that 3D rigidbody doesn’t have gravity scale). No luck finding a perfect algorithm to match anything up