# TheCalm

Member

5

100 Neutral

• Rank
Newbie
1. ## Jumping for AI in my platform game

[quote name='Dragonsoulj' timestamp='1331275330' post='4920595'] Your system should have a constant g, should it not? Your entire world would have some form of gravity, and your character that is finished will probably be using the same constant. [s]At mid jump, the apex, your V0y would be 0. At the start and the finish, your V0y would be 0. Mid-jump, your V0y would be your previous Vy. I may be wrong on that very last statement, but I don't think so. If V0y was to consider your initial jump's starting velocity, the character is not moving, so that would fully eliminate V0y * t.[/s] EDIT: As an afterthought, and due to it being late, V0y would be a function included in your equation for y, and each point during the jump would recalculate the equation with a different t: y = (g * t + V0y) * t - ((g * t^2) / 2) where V0y is the very first velocity you want to give the character to jump. -- To clarify: (g * t + V0y) is the velocity the character is at at the end of the last update. [/quote] Thanks The problem is that even though i set a constant "g" and a constant "V0y" the jump doesnt seem to land on the exact position i want to. Sarah seem to land to far :/