i know you can do Vector3.distance but i want it like this
Distance = Middle
Pivot = Center Of Object
I cant change the pivot to world because i want every other object in local view
i know you can do Vector3.distance but i want it like this
Distance = Middle
Pivot = Center Of Object
I cant change the pivot to world because i want every other object in local view
Hello there,
If you don’t want the distance between the center of the two objects, you have a few options:
I hope that helps!
Cheers,
~LegendBacon
create two empty gameobjects, place the gameobjects (there pivot) where ever you want and drag your gameobjects into the empty gameobjects.
the distance is the magnitude of the difference between the two pivots
float distance = (go2.transform.position - go1.transform.position).magnitude
but in my case i can’t change pivot like anyhow (Strictly prohibited). Because i have objects with different type of meshes(not only square or rectangular). So i can not subtract “half the size of each object on the right axis” , there are not same size edges.
what i am looking for:-
A method by which i can find all vertices of an object and compare distance from all vertices from another object .
working in Unity 2017.1 (WebGL)
Any reference please?
Thanks in advance…