How would I get the distance between two objects... I did this but I cant figure out what im doing wrong. ... Code (csharp): var objectA : GameObject; var objectB : GameObject; private var moved : int = 0; function Update () { var dist = Vector3.Distance(objectA.Vector3, objectB.Vector3); print ("Distance to other: " + dist); }
You should be using ObjectA.transform.position and ObjectB.transform.position as those have the values of the objects' positions.
Yes, put them there. You aren't given them a Vector3 now, you have to give it an actual Vector3 with values, such as a transform's position (which is a Vector3).
by chance would you have a skype account? and if do by chance could we be friends and if i have some quick script problem get your help ? and maybe be buddies test projects or something also ? be alot faster than forum XD Thank you the script works now btw =)
I do have a Skype account, but I'm actually a pretty busy person. So if you have questions, post them here with as much detail as possible and one of the many competent programmers will surely help you.