First person weapon jittering

Hello everybody.
Making FPS I encountered strange problem – first person weapon jittering depends on player distance to zero coordinate. Looks like jitters effect appears at 500 units from the zero point and getting worse with increasing distance. Weapon renders with different camera (child of main camera) in order to render with smaller FOV. Camera settings (FOV, clipping planes) have no effect on jitters.
Is any way to fix it ? I found several similar questions but without answers… Thanks.

Here are some videos to demonstrate. Pay attention on optic scope frame.

Zero distance. No jitters.

500 units. Jitters become visible.

1000 units. Jitters quite visible and annoying

This is your standard floating point precision issue. The further from 0,0,0 you get, the less precision you have. Normally you’re not close enough to something for it to be obvious, but moving the scope so close to the camera it becomes obvious.

You might be able to hide the issue by not actually moving the gun close to the camera, but instead make it bigger so it fills the same area of the screen. Otherwise you need to change how your game works so that it keeps the player close to the world origin and you move the world instead.

Or you can switch to the HDRP where they fixed this issue.

1 Like

Brilliant ! Just added empty GameObject with scale 10 and made first person weapon child of it. Problem solved.
Thanks a lot !!