- Home /
Determine if an object passes a point along a vector
I'm trying to make projectiles travel a percentage of their destinations, randomly.
How would I determine if I pass the point in any orientation?
I know I can get the point from using Vector3.Lerp and pass in a percentage which returns the vector I want to terminate at.
What I don't know is how would I determine if I reach the point? I want to disable the projectile before its collides with the target for some projectiles.
capture.png
(41.5 kB)
Comment
Answer by andrew-lukasik · Apr 28, 2021 at 11:28 AM
bool passed = Vector3.Dot( (end-start).normalized , (p-end).normalized ) > 0;
Your answer
Follow this Question
Related Questions
What could be the reason 1 Answer
2D angle of two Vec3 0 Answers
transform.right to vector3 1 Answer
Help with ITween multiple objects on path with slightly random path points 0 Answers