#Camera Movement (Camera Jitter)

1 messages · Page 1 of 1 (latest)

shell ocean
#

Camera Movement (Camera Jitter)

Problem: Currently the entire scene jitters in unison in the game window.
This occurs when player is moving. I believe that the camera is not in sync with player movement updates.

Previous Iterations:
In previous versions the camera/scene movement was smooth, but the player but text in scene would bounce.

At first I thought the UI elements were having update issues with math between screen/world space. However, it was simply player movement jitter.

I have been working with Chat GPT to try to trouble shoot, and have fixed the player movement jitter. Unfortunately I can't seem to get the camera to sync with player without reintroducing previous problems. At this point Chat GPT is just repeating the same set of solutions and I am going in circles.

Here are both Current scripts:
Camera Follow: https://hatebin.com/audbfhwsbf
Click to Move (navmesh): https://hatebin.com/cpbfpedtww

Current Editor Settings:

Player has:

  • Box Collider ( To prevent player from moving through spawn objects not baked into navmesh)

  • Nav Mesh Agent
    Base Offset 0.5 / Steering Speed 15 / Angular Speed 520 / Acc 30
    Obstacle Avoidance Radius 0.5 / Quality: Low /

  • Rigidbody
    Mass 1 / Drag 0 / Angular D .05 / Interpolate: None / Collision: Discrete / Constraints: Freeze Position: Y / Freeze Rotation XYZ

  • Character Controller
    Slope Limit: 45 / Step Offset: 0.3 / Skin Width: 0.08 / MinMoveDistance: 0.001
    Radius: 0.5 / Height: 2

TroubleShooting:

  • Add/Removed RigidBody

  • Changes Navmesh Agent Settings

  • Tried Interpolate for player

  • Turned Gravity to False

  • Tried Adjusting Collision Detection

  • Tried modifying script for movement update sync between player camera.

  • Tried banging head against wall, also ineffective. lol

Finally I want to stress, the player is moving super smooth, and so are the other elements, I really think the trouble is with synching of player/camera movement.

Thank you in Advance.

#

Also please let me know if this is better for general or advanced category, thank you!

pastel arch
#

you cannot have a Rigidbody and CharacterController component on the same GameObject. they use different types of movement and will conflict with each other . . .

#

also, it's much easier to use Cinemachine for camera movement. easy to setup and there are a bunch of tutorials for it . . .

shell ocean
#

I removed both, and didn't see an improvement with camera jitter.

shell ocean
#

@pastel arch so I looked into Cinemachine and I honestly believe it could create dozens of new problems for me, vs. just allowing me to fix one pretty narrow issue I am currently dealing with.

#

Plus I could still have the jitter in the end.

pastel arch
shell ocean
#

player movement Jitters were corrected this morning.

pastel arch
#

you'll probably have to look at (older) tutorials for camera movement. most people use cinemachine now . . .

#

how are you moving the player? with AddForce, by velocity, or kinematic rigidbody and MovePosition?

#

you have to place the camera movement code in the correct Update method and make sure the rigidbody settings are correct to avoid jitter . . .