- Home /
How to Stop GameObject(character) from shaking
I had believed that having multiple large gameobjects with thousands of verts and setting the camers "Far" Clipping Plane to over 2000 would cause more gameobjects to be rendered at any one time during gameplay and that it may be the cause of the shaky game .
or having objects scaled too large ....
But after removing all my gameobjects and only leaving the player in the game but when i run the game my character ... which is a spaceship still shakes while flying.
Could too many ignored errors in my game cause this ?
here is the flight simulator pack from which i got the codes for the ships motion and camera motion script http://www.4shared.com/file/ESfLLhBa/flight_engine.html
Sounds like some kind of bugged movement tracking. Some ping-pong motion occurs when a model never reaches its 'at rest' variable values. Go over your motion script and find places where motion gets overridden
thanks, that sounds about right . I will look over the motion script again
Often shaking is caused not by player movement but by camera movement. Having camera movement code executed in LateUpdate() often fixes these problems.
here is the pack with the game i'm trying out http://www.4shared.com/file/ESfLLhBa/flight_engine.html i am using the movement script and camera motion script from the pack in my videogame on my camera and my space ship. if you all a a large gameobject into this pack and run the game you will see the shaking .
Shaking could also be caused by placing your objects very far away from the scene origin (0,0,0) since Unity uses single precision vectors. Since you mention your character is a spaceship, are you placing it "out in space" so to speak, using very large X,Y,Z values? Doing so could cause the object to appear to shake (called spatial jitter).
Answer by Alanimator · Aug 26, 2013 at 01:54 AM
For others who have this problem there are a few possible causes .
(1) the motionscript on your space ship return to its (0,0) position overriding the rest position value which in my case is (0,0,0). you will need to ensure that you smoothly return to rest position after moving through any angle .
(2)you need to check the follow script on your camera, executing the camera follow script in LateUpdate may help.
(3) the issue is caused by spatial jitter which is caused by pacing objects too far way from the (0,0,0) of the scene or creating rather large gameobject with massive scale values.
Thanks for this, I had no idea what was causing it for me, but once I changed my camera to LateUpdate I was fine. What exactly is the mechanism behind LateUpdate that makes it work better?
Answer by gsteigert · Nov 03, 2016 at 02:13 PM
Using LateUpdate for updating the camera position solved the issue for me.
Answer by Righteousice · Jan 11, 2021 at 07:57 PM
LateUpdate worked here too. I knew it was an easy fix.
Your answer
Follow this Question
Related Questions
Why does rotating a camera with a rigid body cause the GPU extra work? 0 Answers
Shader to a Camera 1 Answer
How to make camera position relative to a specific target. 1 Answer
how do i make first person character rotate left and right along with camera? 0 Answers
iTween.ShakePosition freezes Rotation 0 Answers