Answer the question
In order to leave comments, you need to log in
How to check for Vector3 in C#?
There is an outlon point (Vector3 class variable), how can I make a condition so that if the player crosses the line, the radius of this point is 10.5f?
I managed to make a similar if condition only if the player is exactly on the point itself, but how to do this only with a radius of 10.5f ?
PS the user variable is the player.
user.position - player's location along XY Z axes.
outlon - point with XY Z coordinates.
Answer the question
In order to leave comments, you need to log in
Just check distance between points:
var dist = Mathf.Abs(Vector3.Distance(outlon, user.position));
if (dist<10.5f) // попал
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question