Search Unity

How to use new input system to make player look at object in first person?

Discussion in 'Scripting' started by silverleecams, Jul 14, 2022.

  1. silverleecams

    silverleecams

    Joined:
    May 12, 2022
    Posts:
    51
    I have a first person Game where my player can walk around, jump, and look around via the Cinemachine camera, however he does not face the direction the camera is pointing, rather his body is static angle-wise. He constantly faces the same direction regardless of where the camera is pointed. How to make his front follow the camera direction?

    For simplicity, the camera is set to look at a game object called CameraHelper2 and is positioned on another object called CameraHelper; perhaps I can use these objects somehow?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Keep your systems separate... input system new vs old is irrelevant to camera looking. Input is just data over time. Understand what input is coming in, process it appropriately and change the state of your cameras.

    Work through some Cinemachine camera tutorials for doing what you need. Often these sorts of effects are done by having more than one virtual camera and switching between them.
     
  3. silverleecams

    silverleecams

    Joined:
    May 12, 2022
    Posts:
    51
    Will try, thanks