Search Unity

Rotating object then back to original position

Discussion in 'Visual Scripting' started by Deleted User, Apr 7, 2021.

  1. Deleted User

    Deleted User

    Guest

    Hello all, I'm making a game using a joystick, i'm working on that if it the player is idle, and it shoots somewhere else the player rotates towards it and back. What I've done now is that when it shoot, it rotates to where it shot. How do I make it rotates it back to where it was. I have this so for it's rotation.
    Code (CSharp):
    1.  
    2.         Player.LookAt(AttackLookAtPoint);
    3.  
    4.         Player.eulerAngles = new Vector3(0, transform.eulerAngles.y, 0);
    Thanks in advance!!