Third Person Cinemachine Integration

Kaizen

New member
Hello,

I have some problem with the cinemachine integration for the third person controller.

My project is pretty new & clean.
Unity 2021.2 URP + latest version of TPC

This is what I did (following the documentation):
  1. Install the TPC + UFPS
  2. Configure the scene
  3. Configure the Nolan Character (added some abilities from the agility pack)
  4. Install and configure cinemachine integration
  5. Create a cinemachine freelook camera + spring component (see screenshots)
    1. Follow character object
    2. Target the Neck in the
    3. Tweaked a bit the composer and some settings
  6. Add the collider extension
Global camera movement is fine but I have some big camera jittering when moving (see video). Note that if I'm using the Opsive Third person view type, everything works very well (end of the video) but I'd really like to use cinemachine for future timeline smooth transition between gameplay and cutscenes.


It's been 2 days of try and fail to have a correct behavior with cinemachine, can you help me figure it out? (I also tried a classic Virtual camera with the same results)

Capture.PNG
Capture2.PNG
 
Last edited:
What Update Mode are you using for the controller? I would try adjusting that along with the Update Method from the Cinemachine Brain.
 
What Update Mode are you using for the controller? I would try adjusting that along with the Update Method from the Cinemachine Brain.
I tried pretty much everything. The best option for now is Update mode for the controller with a component that sets the Application.targetFrameRate (I put 120)
It still feels weird and I don't know why.
Here is the behavior of the camera with this setup:
  • CM Brain = smart update
  • Controller = update
  • Application.targetFrameRate = 120
  • vsync = Every V Blank
(Does the yellow target bouncing like that normal?)



I did try also:
  • CM Brain = fixed update
  • Controller = fixed update
  • Application.targetFrameRate = disabled
  • vsync = none
The result is really bad for the player but it seems that the background is totally fine:


I saw on various posts that it could be due to the rigid body interpolation so I tried to put all the player rigidbodies to interpolate but without success:


Also tried to change the Fixed Timestep to 0.01 without success.

I'm really out of ideas, I think I tried all the combinations possible...
I think tomorrow I'll create a new project with just the TPC, and add the cinemachine viewtype to the demo and see how it goes by default (I have the same problems in the demo in this project)...
 
Hello,

I did a few tests in a brand new 2020.3.21 URP project
  • Create URP project (all by default)
  • Install opsive TPC
  • Install cinemachine
  • Upgrade materials
  • Setup the scene in the sample demo scene (all by default)
1st test:
  • Put nolan prefab in the sample scene
  • Setup the character (all by default, method is fixedUpdate)
  • Result: Looks good

2nd test:
  • Install cinemachine integration
  • Create a freelook CM, assign follow and target
  • Brain motor by default: Smart update
  • Camera controller viewtype = third person cinemachine
  • Result: Nolan looks good (I think), background elements are jittery
3rd test:
  • Brain motor fixed update
  • Camera controller viewtype = third person cinemachine
  • Result: Nolan is jittery, background looks good
4th test:
  • Open the TPC demo
  • All by default (controller is fixedUpdate)
  • Camera controller viewtype = third person adventure
  • Result: Looks good
 
5th test:
  • Open the TPC demo
  • All by default (controller is fixedUpdate)
  • Create a freelook CM, assign follow and target
  • Brain motor by default: Fixed update
  • Camera controller viewtype = third person cinemachine
  • Result: All jittery (and Aim is wrong, see second video)
6th test:
  • Open the TPC demo
  • All by default (controller is fixedUpdate)
  • Create a freelook CM, assign follow and target
  • Brain motor by default: Fixed update
  • Camera controller viewtype = third person cinemachine
  • Remove all damping (camera controller, and CM body/target)
  • Result: Weird Nolan behavior + jittery
I really don't know what to do next, I really want to use cinemachine for smooth gameplay to cutscene transitions so if someone has a working integration/setup please let me know.
 
Last edited by a moderator:
Please do not upload the project file as not everyone has access to the character controller. For my test scene I have:

Cinemachine Update Location: Smart Update
Character Update Location: Fixed Update

I am not using URP but I don't think that would have mattered.

I really want to use cinemachine for smooth gameplay to cutscene transitions so if someone has a working integration/setup please let me know.
For that I recommend disabling the Camera Controller/Handler component and letting Cinemachine have complete control. When you are ready to switch back you can then enable the Camera Controller/Handler and disable Cinemachine. That way you don't need the integration at all.
 
Please do not upload the project file as not everyone has access to the character controller. For my test scene I have:
First of all, sorry about the files, I didn't realize. In my mind the forum was for customers only but no...

For my test scene I have:

Cinemachine Update Location: Smart Update
Character Update Location: Fixed Update
Is it possible that you share this test project with me or is it confidential? I'm interested to see the difference between my project and yours.
If it's not possible I understand.

For that I recommend disabling the Camera Controller/Handler component and letting Cinemachine have complete control. When you are ready to switch back you can then enable the Camera Controller/Handler and disable Cinemachine. That way you don't need the integration at all.
I'll do some tests today. I guess you mean that I should use the provided viewtypes and once my cutscene is triggered I disable the Opsive Camera Controller and Enable the CM brain. I'll try that hoping I can have a smooth transition between the Default camera and the CM camera
 
Please do not upload the project file as not everyone has access to the character controller. For my test scene I have:

Cinemachine Update Location: Smart Update
Character Update Location: Fixed Update

I am not using URP but I don't think that would have mattered.


For that I recommend disabling the Camera Controller/Handler component and letting Cinemachine have complete control. When you are ready to switch back you can then enable the Camera Controller/Handler and disable Cinemachine. That way you don't need the integration at all.
Did you get the chance to try my test project?
 
Here's a test scene that just has the third person perspective setup. I haven't had a chance to look at your project yet but I am definitely not a Cinemachine expert so lets start with this scene that works.
 

Attachments

  • ThirdPersonCinemachine.unity
    169.3 KB · Views: 12
Here's a test scene that just has the third person perspective setup. I haven't had a chance to look at your project yet but I am definitely not a Cinemachine expert so lets start with this scene that works.
Thanks for the test scene. I opened it in my test URP project. Looks fine without anything in it but it doesn't as soon as I have some props in the scene. Which my game and pretty much any other game will have ;)

here is what I did:

  • In my URP 2020.3.21 test project
    • Copy your scene into it
    • Opened your scene
    • Change the plane material (wasn't URP compatible)
    • Extended a bit the plane size
    • Put some props and moving objects
    • Result: Nolan looks fine but the world is jittery

  • Created a new Builtin project
    • install cinemachine
    • install TPC
    • update layers and buttons
    • install cinemachine integration
    • Copy your scene into it
    • Opened your scene
    • Extended a bit the plane size
    • Put some props and moving objects
    • Result: Nolan looks fine but the world is jittery
I don't know if there is any problem related to my setup or if this is linked to my unity installation but I honestly don't think so. Are you able to have a working scene with world elements on your side? I could share my scene (or test project by MP) if you need it
 
Hmm, I just added 100 crates and 10 moving platforms and it still was ok. If the addition of props is causing a problem it almost sounds like it's framerate related. If you profile your scene do you have any bottlenecks?
 
I ended up using a classic Vcam with these settings
Capture.PNG

Smart update for the brain and Update for the locomotion motor and fixing the framerate to 120.
It does look good without vsync activated.
If I find some more time to investigate, I'll try profiling to search for bottlenecks.
 
Top