Hi. I have a weird camera jittering while my player is on the moving platform
I use two cameras. One free-look camera and one virtual camera for my “aiming” purposes
When I step on the moving platform, on activating free-look default camera, my environment is jittering.
If I switch to my aim camera, the jitters transfer on my third person character.
Jitter amount is lowering when I look ahead, and raises when my character turn left or right.
I am using fixedUpdate to move my platform, since my character is rigidbody based.
Looks like the vcam and the character are not animating on the same clock.
What is the Update Method setting in CM Brain?
When the project is running, look at the inspector of the active vcam. Next to the “Solo” button, it will show how the vcam is being updated (FixedUpdate or LateUpdate). What does it read for your 2 vcams, when the jitter is happening?
Hey Gregoryl. My update method from main camera is set to “Smart update”
On game running It says “late update”
I tried switching it to “Fixed update” from the main camera. and that fixes the problem with platforms.
However this way, my character start jitters when he is not on the platform
In that case, it’s very likely that you aren’t moving the platform smoothly, or are not moving it exclusively in Update() or FixedUpdate().
If your target character is animating on FixedUpdate() - perhaps because it is a rigidbody - but your platform is moving on Update(), that is a problem because the camera won’t know how to follow it. What happens if you move the platform in FixedUpdate() only?
This way (both ways actually) breaks my functionality of the platforms … Maybe I should check my rigidbody. It’s weird that changing the main camera update method to “fixed update” from “smart update” fixes my problem with the platforms, but open a problem with my character controller…
My point is that this bit (Time.time - startTime) * speed should be replaced with something that relies only on Time.deltaTime. Adjust your code accordingly.
I tried testing your code, just to see is there any difference in the behavior of the player after replacing Time.time with time.deltaTime.
I read the above topic and it is really informative.
The player still jitters on the platform. Is it possible the issue to be in my player controller script?
Ok. I don’t have any idea why this, but it gets actually better after I turn character controller rigidbody Interpolate from “Interpolate” to “None”
I hope it won’t affect on my physics
What happens if you leave interpolation on, but move your platform in Update() instead of FixedUpdate()? That way everything will be happening on the render clock instead of on the physics clock, and the cameras will be happy.
The thing is that if I turn on interpolate of my character rigidbody only “left” and “right” movement is jittery… The forward and backwards movement is still smooth.
After making platforms on update instead of fixedUpdate and turn on my interpolate I get jittery movement from the player not from the camera while the platform is moving.
I suspect that it’s equally jittery in all directions, only you don’t notice it front-to-back because the effect in perspective will seem very small when compared with side-to-side.
How does the player move when it’s on the platform? What makes the player not just stay still while the platform moves out from under him?
I am making a similar to platformer game, so I would have platforms that move constantly and my player needs to be able to jump precisely from one to another.