My game is a First Person Shooter.
Mech-Collider was too inaccurate for my taste, so I thought of having a certain code as well as the collider code.
I want to be able to determine the distance from the point I launch the missiles to where they will most likely hit, and then I will use this distance for determining when the missile should blow up if aimed at a wall or the ground.
How would I determine this distance?
construct a vector between the two points you want to measure, then get the magnitude of the vector.
float distance = (endPoint - startPoint).magnitude;
even better to use Vector3.sqrmagnitude -> " Returns the squared length of this vector (Read Only). Calculating the squared magnitude instead of the magnitude is much faster. Often if you are comparing magnitudes of two vectors you can just compare their squared magnitudes. "