Distance between two objects, from the view of the camera.
Hi,
Not sure how I should solve this;
I have two moving objects in a 3D world, one is trying to hit the other. I store StartVector/StopVector & Velocity on each object. They might hit (collider will catch that) or miss completely where I store the StopVector when they hit a maximum distance.
Anyway, I need to know how far off from the perfect hit it was, and I need it in a "2D" result from the perspective of the camera/shooter.
I.e. You hit 30cm LEFT and 10cm LOW Even if it was a hit I need to know how good of a hit from center-> center
Any help is REALLY appreciated!
Tried using ClosestPointsOnTwoLines but that does not work really since the objects move at different speed, the line where they have passed is not where optimal point was. Even if I get the two vectors where they where closest, I do not know how to translate that into left/right/up/down from viewer perspective...
Best regards Fredrik
Your answer
Follow this Question
Related Questions
How I can make my camera keep a distance between two objects? 0 Answers
Camera Reset Script 1 Answer
Global direction (e.g. Vector3.forward, Vector3.right) from Mouse drag 0 Answers
Error with vector3.distance 0 Answers
Unity 5 FPS Camera 0 Answers