Search Unity

Dragon Age: Inquisition (DA:I) camera

Discussion in 'Cinemachine' started by Levi-Burton, Jan 27, 2020.

  1. Levi-Burton

    Levi-Burton

    Joined:
    Jul 9, 2012
    Posts:
    10
    Hello --

    This mostly relates to the DA:I *gamepad* input.

    I'm trying to figure out how to get the free look camera to act more like the DA:I camera. I know that is way over-simplifying things. It's the little things that make it stand out, though. For example -- in DA:I, the direction the player moves is not always aligned to the camera. If I look around, while moving, the direction im moving in remains the same. Little tricks like that make a big difference, and am just wondering if anyone had any tips on how to setup the freelook camera to at least start to behave somewhat like the DA:I camera.

    I'm already using it on a custom controller that controls animation root motion movement, and out of the box it works well. I'm good with having to write C# components, too, so no issues there.

    As always there's probably a million ways to do it. I'm just looking for someone to point me in a good direction.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,375
    How you control the character is independent of how you control the camera. You can set up your character controller so that "move forward" will move in the camera's forward direction, or in the character's forward direction. It's up to you how you want to interpret the player's input.

    The code that moves and rotates the character will reside in your character controller script. The question to ask is: when player input comes in, is it being applied in camera space, or in character space?
     
  3. JeffG

    JeffG

    Joined:
    Oct 21, 2013
    Posts:
    14
    If I understand your question correctly, you need to adjust your player movement vector based on the direction of the camera.

    Something like this

    camForward = Vector3.Scale(cam.forward, new Vector3(1, 0, 1)).normalized;
    move = moveInput.y * camForward + moveInput.x * cam.right;

    if (move.magnitude > 1) move.Normalize();
     
  4. Levi-Burton

    Levi-Burton

    Joined:
    Jul 9, 2012
    Posts:
    10
    Hey guys when I posted this I have *no clue* what I was thinking. I was frustrated with a my current camera stuff but it was all due to a silly bug of my own. Shortly after I posted this everything works exactly as I wanted. My movement is done exactly the same as JeffG suggested.

    Oh and I'm loving Cinemachine by the way. I'm using the freelook component with great success.
     
    Gregoryl likes this.
  5. Levi-Burton

    Levi-Burton

    Joined:
    Jul 9, 2012
    Posts:
    10
    Hey Gregoryl, just wanted to kind of show-off what I love about Cinemachine -- the blending. This is just a small prototype example of my 3rd person player controller transitioning to a couple of vcams in a homebrewed cutscene (using Timeline), then back to the player again. I'm using a gamepad for input in this video with typical left stick move and right stick look.

     
unityunity