Log in or register to post comments

Calculate distance between two objects

SDK 10.0
August 25, 2021 - 3:10am #1

Hello,

Can you please tell me how to calculate distance between two objects that are on the ground plane.

I have tried with transform.position but something is not working well ie. it is crashing my text object.

 

Best regards

SDK Version: 

Calculate distance between two objects

August 26, 2021 - 3:48am #2

Hey there,

 

Usually you'd use Vector3.Distance to calculate the distance between two vectors: https://docs.unity3d.com/ScriptReference/Vector3.Distance.html

 

Kind regards,

Patrick Scheper

Technical Community Manager

Log in or register to post comments