Third Person Camera jitter

Shadowing

Member
So one of the large reasons I switched to version 2 of the character controller was this weird Jitter when rotating the character in 3rd person.
I think I showed you this a long time ago before I made the switch @Justin
I'm pretty sure it didn't do this back in 2019 when I first started using version 2.

Video below. As the character rotate he jiggers does it in your demo too.

 
If you set the Third Person Combat's Position Smoothing value to 0 then it'll fix it. I'll make this same change in the next update.
 
Thanks Justin
Ya that fixed your demo guy. I can still see him jittering a little though very slightly. Could just be the rotate animation of the legs idk lol.

Unfortuanlly it didn't fix my character in my scene for some reason.


 
Ahh I just noticed if I enable root rotation the character stops rotating of course. But the camera rotates and I can see the jitter. So now I know its a camera at least now. Thought for a while could be character rotating lol. Also does that sound like it rules out the camera keeping up with the character on rotation?
Which is why the settings you told me to change isnt working.

Could this be some sort of mouse input issue?
 
For combat you should not enable root motion rotation as unless for very specific scenarios. This will prevent the character from rotating with the character.
 
Alright while I'm trying to figure out this issue. I started a new project.
I noticed a little bug in Ultimate controller.
When you use the manager to setup a Third person camera.
It sets up adventure to act like combat and combat to act like adventure.

so otherwise it opposite of what your demo is set too.


When I have it set to combat by using the camera setting son the demo
I notice my character does this when rotating. Shouldn't the character always be facing forward in combat mode no matter how fast you rotate?
It was hard to tell if your character does this in your demo. This only happens when the player isn't holding a weapon too I believe.

 
The character rotation speed is dependent on the motor rotation speed. Adventure mode will behave similar to combat when you are aiming.
 
I"m getting hit with this error when adding all the weapons from the demo when using the existing character tab on the manager


Error: Unable to find the movement type with name Opsive.UltimateCharacterController.FirstPersonController.Character.MovementTypes.Combat.
UnityEngine.Debug:LogError (object,UnityEngine.Object)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:SetMovementType (System.Type) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:566)
 
You can see the jitter issue doesn't happen in that video I posted earlier today too.
So im on a mission now trying to figure out why it happens in my project and not on a fresh project.

I disabled everything in my scene and it still does it.
Thought about starting from scratch since I updated from a version of ultimate controller 2 years ago.
Maybe some layer change or something like that is causing this.

Or maybe its how I have the character anchored. I'll look into that.
 
Ahh @Justin!!! I figured it out. Took like 12 hours lol.

It happens when I don't use the option to Init the character on Awake.
So I assign the Character and Anchor by script on the Camera Controller
Enabled the Camera Controller it after assigning those two references.

So probably some settings to the controller isn't going into effect. Probably Position smoothing.

This thing was driving me crazy for hours so glad I finally figured it out.
Let me know if you can reproduce that.
I didn't try to reproduce it on your demo though. But it defiantly removed the issue on my character and it makes sense since the demo uses the Awake option.
 
The jitter happened because of the position smoothing. This is because there is a double smoothing going on between the camera controller and kinematic object manager. The correct fix for this case is to set the smoothing value to 0. You will get the movement type error if you do not have that movement type added to the Movement Type list.
 
Ya I was able to duplicate what you are saying but there is another problem.
If you init the character by script instead of just having the character sitting in the scene on awake. "Like how your demo is" All those smooth settings or something becomes broken.

I have covid righ now. I've been fighting for my life for the last week. I can make a test project and duplicate this in the demo when my strength gets up.
 
Alright I tore my project down to 4gb.
Here is a new video of the issue. This is with smoothing set to 0.
I believe now the issue isn't just Init the Character its also when you Init the Camera.
I sent you a private message with the link to my project. I tried to simplify it as much as I could.
I have two issues going on here actually. Can't figure out why the camera doesn't stay with the character while hes spinning too. Might all be related to the same issue though.

 
With just a character and an empty scene it should be a much smaller file than 4gb. I have attached a scene which initializes the camera at runtime and it doesn't have any issues. Can you create a fresh project and modify this scene/script to show the issue? The camera will attach when you press the I key.
 

Attachments

  • InitCamera.unitypackage
    12.1 KB · Views: 2
I haven't been able to duplicate the issue yet in a fresh project.
I think the size is just the animation folder taking up space. I can reduce it some more. do you not have fast internet?
I'll check your project out.
 
Ya no issues with your scene. The cause of the problem is Unknown then still.
well crap.

btw a project with Ultimate controller on it is 3.23gb with no compression.
My character is 1gb
Animations in my project are probably 2gb
Rest is ultimate controller which puts it at 4gb.

I had this working fine with my character so already ruled that out.

maybe I'll figure out the issue by removing few more scripts.
I can't solve the problem by reproducing it in your empty scene cause i have no idea the cause of it.


I did notice one odd thing.
In my project if I int character and camera and add the character to the camera in a single frame. The camera won't follow the character.

I modified your scene and it lets me do that in a single frame. so thats wierd.

By the way when i use the word int I mean using Unity api Instantiate()
 
I figured out the problem.
Its when I create a gameObject on the Character for the Anchor Point.
Then I give that game Object a position of say Vector3(0f,2.15f,-2.52f)
And then I give the Camera Controller anchor position a value of like Vector3(0,.77,2.85f)

Idk if this is a real issue or not. Idk why i just don't edit the camera anchor offset only.

Here is my script to add to your test scene.

Code:
using Opsive.UltimateCharacterController.Camera;
using UnityEngine;

public class InitCamera : MonoBehaviour
{
    public GameObject m_Camera;
    public GameObject m_Character;


    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.I))
        {

            CameraController cameraController = Instantiate(m_Camera).GetComponent<CameraController>();

            GameObject character = Instantiate(m_Character);

            Transform CameraAnchor = new GameObject("Camera Anchor").transform;
            CameraAnchor.parent = character.transform;

            cameraController.Anchor = CameraAnchor;
            CameraAnchor.position = new Vector3(0f,2.15f,-2.52f);


            cameraController.Character = character;
        }
    }
}
 
Instead of setting the camera anchor I would instead just set the offset directly on the ViewType. The anchor isn't rotating at the same rate as the character which is causing the lag.
 
Ya. not really an issue. Glad I finally figured it out. Now i can continue to get this version 2 of this controller into my project I've had paused for 2 years lol.
 
Top