#at the top of its jump the ball s y
1 messages · Page 1 of 1 (latest)
Update:
- Using vf^2 = vi^2 + 2*a*d, I was able to calculate the velocity I want the ball to start jumping at. However...
- ForceMode2D does not seem to have a VelocityChange mode (this appears to be exclusive to ForceMode3D), so I directly changed the ball's velocity instead.
A couple questions:
1.) The ball will now ALMOST jump 3 diameters high, but not quite by, like, one-fourth of a diameter. What is causing this?
2.) Does my solution seem like a good one, or should I look for a more elegant solution?
probably it's not jumping quite high enough because your rigidbody has some drag
the equations assume no drag
if you want to solve it with drag, the force applied by the drag is -velocity * drag, so the acceleration is -velocity * drag / mass, but that's applied continuously over the course of the jump
solving the actual height that it arrives at requires some calculus (really it is a differential equation). I don't think there is a way to do it with just algebra (though I'm a bit braindead right now, so I may be overestimating it)
as for question #2, it depends on the kind of game that you're making
If you're making a physics based game, this is probably the best way to go about it
but if you're making something where you want the ball to move in a more precise way (like you would in a platformer), making the rigidbody kinematic and actually taking control of all of its movement might give better results