Hi,
I want to use an cube(lets call “A”) to move other objects(cube or capsule). Other objects will be moved when the object “A” is forwarding closely to these objects. Thus, i want to get the distance between “A” and other objects. So, i want to know the center coordination of an object? Thanks.
Brilliant general solution, would up-vote but not enough karma :P
– Matt_NBI'll up-vote it for you, Matt_NB.
– ZiadThanks. In 2017 this code is gone, instead you can use GetComponent< Renderer>().bounds.center
– jethrogillgrenRenderer can no longer be found in Transform. GetComponent<> has to be used, as pointed out above!
– marcospgpand to get the center (average idk) of a position of a transform with multiple mesh renderes inside of it? Unity has this function when you change it from Pivot to Center in the handle position
– gabriel_depaula2003