Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity get distance between two objects

// Vector3.Distance is the same as (a-b).magnitude

float distance = Vector3.Distance(a.transform.position, b.transform.position);
 
PREVIOUS NEXT
Tagged: #unity #distance #objects
ADD COMMENT
Topic
Name
5+1 =