Hey guys, I need a raycast to check the distance between two points for an “if” statement. So as an example:
if("Distance of Ray" > 10)
{
//Do something
}
else
{
//Do something else
}
Thanks in advance!
Hey guys, I need a raycast to check the distance between two points for an “if” statement. So as an example:
if("Distance of Ray" > 10)
{
//Do something
}
else
{
//Do something else
}
Thanks in advance!
To check the distance between the two points you can use: Vector3.Distance(origin, hitpoint).
Here is the script reference on it: Vector3.Distance