So I have a landing point calculation for the most part working. However, it's only returning positive numbers...when the ball itself moves both ways, X/-X. The game plays out in X/Y coordinates, with locked Z - this is all 2D.
I know I'm on the right track, but I'd really like it to also return negative coordinates. What am I doing wrong in my code? To be honest, it's probably something really stupid!
Vector3 BallMinder = BallPosition.position;
float BallX = BallMinder.x;
float BallY = BallMinder.y;
float GroundHitPointX = (BallX + BallY);
Addtional Information:
The ball moves by pure gravity and physics. No additional forces are added aside from impacts it may take, which are not coded. X serves as position, Y serves as time until the ground.
↧