Search Unity

Question How to make a character rotate not based on world forward? (VS and new input system)

Discussion in 'Visual Scripting' started by M_Keyla_M, Jan 4, 2023.

  1. M_Keyla_M

    M_Keyla_M

    Joined:
    Dec 24, 2014
    Posts:
    57
    Does anyone know how i can get my character to start turning from the forward of the camera?
    e.g. you rotate the character on it's own a couple degrees (40 or something) but the camera is still facing a different way. When you start rotating the player again the forward of the player should become the forward that the camera is facing. It should not continuously follow the camera forward but only when you rotate the first time.
    I included the screenshots from my script. The character turns and stops to face the direction it last turned in but when i press forward again the player faces the world position forward.
    I just can't seem to figure out how to make it face the camera forward and then continue on its own. (e.g. the game Journey has the movement im hoping to achieve)
    Please help, been stuck on this for days :(
     

    Attached Files:

    Last edited: Jan 5, 2023
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    This isn't a physics system question and is best asked on the Visual Scripting forum.

    I'll move your post for you.
     
    M_Keyla_M likes this.
  3. M_Keyla_M

    M_Keyla_M

    Joined:
    Dec 24, 2014
    Posts:
    57
    Sorry! I asked a movement related question here before so I thought this was the right spot, thanks for moving it!
    Hopefully someone knows the answer here
     
  4. M_Keyla_M

    M_Keyla_M

    Joined:
    Dec 24, 2014
    Posts:
    57
    Edit: Changed the name of the question to better fit what im looking for