Search Unity

Cannon follow camera rotation.

Discussion in 'Scripting' started by cruising, Aug 6, 2018.

  1. cruising

    cruising

    Joined:
    Nov 22, 2013
    Posts:
    329
    Hello!

    I have searched and did not find anything that could help me.
    My issue is to have a cannon to rotate with the camera (follow camera rotation from its own coordinates).
    Like if the pilot(camera) looking a little to the right, the cannon turns little to the right, if the pilot looks a little up, the cannon rotates a little up, they should just simple follow the camera facing angle.

    the cannon is in 2 separate objects, 1 object for the Y rotation, and 1 parented object for the X rotation
    Any ideas?

    Regards
    Cruising