brainwipe / Cloudship

A Unity 3D learning project
2 stars 0 forks source link

Particles jitter when at speed #72

Open brainwipe opened 6 years ago

brainwipe commented 6 years ago

Split from #55

https://forum.unity.com/threads/some-particles-jitter-when-emitted-others-do-not.542746/

brainwipe commented 6 years ago

Also, buildings jitter and the controller jitters aswell.

brainwipe commented 6 years ago

From Unity:

Hi,

Thanks for your bug report regarding Particles jitter/stutter when using Mesh Render Mode and World Simulation Space`. After further investigation, we have found this is an issue with your camera script.

If you examine the effect using the scene camera in a fixed position you will notice there is no jitter. The problem is caused by the various different update rates. The particle system updates every frame, however, the rigidbody is updated during FixedUpdate and so is your camera. This creates a jitter every time the rigidbody position is updated and it is more prominent because your camera is fixed to the transform with no smoothing. There are a few ways to fix this issue.

1) You could update the camera in Update instead of FixedUpdate and use interpolation on the RigidBody so that it updates itself every frame.

2) Simulate the particle system manually every FixedUpdate so it updates at the same rate as physics (the effect will be less smooth).

3) Add some smoothing/dampening to the camera so it does not clamp itself the transform but uses that as a guide to follow. Cinemachine is very good for this.

I would recommend option 3 as you are likely to encounter other jitter issues as your game gets more complicated.

Kind Regards

Karl Jones Sustained Engineering