Hello, I have been working on a leaping attack for the player and I have ran into a problem as far as forward distance. I am using this to calculate the force:
force = 2*(distance / (jumpTime*jumpTime) - initialVelocity/jumpTime);
rb.AddRelativeForce(Vector3.forward * force, ForceMode.Acceleration);
The problem I am facing is that the force turns out both negative, and isn’t enough to even budge the object. I got this by using the acceleration formula:
distance = intialVelocitytime + 0.5accelerationtime^2
distance - intialVelocitytime = 0.5accelerationtime^2
(distance - intialVelocitytime)/(0.5time^2) = acceleration
2*(distance/time^2 - intialVelocity/time) = acceleration
And I am capturing the intialVelocity in an instant from GetComponent().velocity.magnitude. I haven’t a clue as to why this is happening.