1

I am trying to create a circle of cubes that all face a common middle point in Unity. I was wondering if there is an easier way to face them all inwards than individually rotating each one. They need to be able to fall together, so the middle point must always be at the middle of the circle, meaning that they will be moving with the point moving with them and there can't be any rotation other than in the x-z plane. Any help would be great!

NyW
  • 107
  • 8
  • 3
    How about just grouping them under a single GameObject and rotating them once, then letting Unity handle all the transformation logic? – Serlite Feb 12 '18 at 16:41
  • If Serlites suggestion isn't what you're looking for, can you make a drawing in MSPaint and then edit your post to upload it? Would be great for clarity of what you mean. – Doh09 Feb 12 '18 at 21:28
  • Possible duplicate of [Trying to make an object look at another object in Unity](https://stackoverflow.com/questions/41768486/trying-to-make-an-object-look-at-another-object-in-unity) – Tanner H. Feb 13 '18 at 01:58

1 Answers1

1

You can use transform.LookAt().

gameObject.transform.LookAt(gameobjecttolooktowards.transform);
Tanner H.
  • 304
  • 1
  • 13