#Camera Movement (Camera Jitter)

1 messages · Page 1 of 1 (latest)

rose shell
#

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

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.

scarlet zenith
#
rose shell
#

So based on this article that you posted to me, where am I going wrong in my code?

#

Also you saw that I am using Navmesh right, for click to move, not key press inputs.

scarlet zenith
#

i did, that does not mean the information in the article does not apply. read it to learn how to correctly move your camera on the same time step that your object is moving so that you can implement that yourself

rose shell
#

I read the article, before I replied, which is why I am replying, asking where I am going wrong in my code? The reason I am asking is obviously I am not figuring out myself, despite having already tried the recommended modification the update method that the article refers to.

#

From my understanding Unity Navmesh gets inputs during every frame, or during the Update method, which is what my code has for both player movement + camera. so they should be synced.

#

One day when you are struggling I will just throw an article at you, and tell you figure it out yourself.