Search Unity

How to program third person camera like KOTOR or MMORPGs

Discussion in 'Cinemachine' started by ThisIsWhyImSingle, Sep 12, 2021.

  1. ThisIsWhyImSingle

    ThisIsWhyImSingle

    Joined:
    Mar 27, 2021
    Posts:
    3
    Hello,
    I'm making a third-person RPG similar to Knights of the Old Republic. I was wondering about how I could mimic the third person camera used in that game, where the camera follows the player's movement and rotation but can switch to follow mouse input when the left mouse button is down? Another similar example would probably be in MMORPGs. Should I be using Cinemachine to create this system?

    Thank you in advance!
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Yes. :)

    After you add Cinemachine to your project, you can get our example scenes.
    examples.png
    Check out the AimingRig, 3rdPersonWithAimMode, and Free Look collider scenes. These are slightly different and use different setups.

    I'd probably use the setup in AimingRig with a few modifications for a game like Knights of the Old Republic. I'd remove the 3rdPersonAim component, set the Noise to None in Cinemachine Virtual Camera, and play around with the offset parameters in 3rdPersonFollow. For the mouse input control, see below.

    Check out this video, it covers the switch too:


    Let us know if you are stuck or need further info. ;)
     
    ThisIsWhyImSingle and Gregoryl like this.
  3. ThisIsWhyImSingle

    ThisIsWhyImSingle

    Joined:
    Mar 27, 2021
    Posts:
    3
    Thank you!
    This helped me a lot and I ended up making it work!