Search code examples
c#unity-game-enginegame-physics

Unity- how to make object always face moving camera?


Ok this is what I’m trying to achieve - I have a cube that is in front of my camera. The camera is a magic window, so it’s rotates with the accelerometer. I’ve tried parenting the cube to the camera but the front face is not always facing the camera still. What do I need to do?

Diagram:

enter image description here


Solution

  • Childing is a good first step for actually moving an object.

    For rotation you can use LookAt on your cube