Hello.
I know this is a simple thing to figure out but I’m doing something wrong here.
I have a projectile - ridgidbody moving in 3D space effected by gravity - and I need to know where it will be in N seconds. I can figure out the horizontal easy enough but the vertical (gravity) side of things is not working out.
The second line of the function is clearly wrong but I don’t recall what the solution is.
/// <summary>
/// Calculates where the object will be in n seconds.
/// </summary>
public Vector3 GetFuturePosition(float _InSeconds)
{
Vector3 FuturePosition = (mRigidBody.position + (mRigidBody.velocity * _InSeconds));
FuturePosition += (Physics.gravity * _InSeconds);
return FuturePosition;
}
thanks