Trying to get perfect jumps with Character.
Hello, I am making a game that needs my character to jump very specifically. Visualize this cube as the character.
For instance, if the cube is traveling forward with a velocity of 10m/sec, and there is no friction, I need to figure out a jump velocity to get it to jump up, and fall down a third of its height.
Maybe I shouldn't be using velocity, but I solved for the initial velocity to be 12m/sec when the gravity = 24m/sec^2. With my calculations the cube should reach y = 3m, at its maximum, but instead it gets up to 2.9. This is not good enough, because over a period of time it will become too far off the target. I turned off all drag, and it still reached 2.9m. Is there drag other than "Drag", and "Angular Drag"? I am quite sure my physics calculation is correct, but there has to be as problem somewhere.
V = final velocity
Vo = initial velocity
a is acceleration or gravity
d is the distance traveled
V = 0m/sec because that is the max height
Vo = is what I am looking for
a = -24m/sec2 as I stated
d = the distance traveled y so 3m is what I want
V^2 = Vo^2 + 2a x d
Vo^2 = 2(-24m/sec^2) x 3m
Vo = √(144m^2/sec^2)
Vo = 12m/sec
Once the height is exactly 3 then it should be easy to solve for the distance "x". I just don't know why the number is off. I made these specific values so I could have a real number, "3". So, it is quite useless to get 2.9.
Maybe there is a way easier way to do this. If so let me know.