Forum rules - please read before posting.

Changing First Person Camera out of Free Aim

I'd like to change the camera direction out of free aiming using menu buttons on the screen.

I've 4 arrows button (up, down, right, left) as menu buttons.
When Player clicks on one of them I'd like the First Person Camera to move accordingly.

I was planning to do that in the MenuSystem.cs.

Something like:
if((_menu.title == "DirectionsMenu") && (_element.title == "down"))
            {
                //rotate the camera down
            }

What command I could use?

Comments

  • If you're writing custom code, you're better off asking on the official Unity forums instead.  But if you've stored your camera's transform to a variable called myCameraTransform, something along these lines might work:

    float rotationY = myCameraTransform.localEulerAngles.x;
    rotationY += 1f;
    myCameraTransform.localEulerAngles = new
     Vector3 (rotationY, 0, 0);

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.