Search Unity

Resolved Game object shakes in main camera

Discussion in 'Scripting Dev Blitz Day 2023 - Q&A' started by Thund31, Feb 23, 2023.

  1. Thund31

    Thund31

    Joined:
    Feb 15, 2023
    Posts:
    12
    I am using physically based sky in HDRP to create a space game, and I have placed satellites in the orbits around the planet. The satellites move in a circular orbit around the planet via rotating their parent game object which is located at the planet centre. The main camera is set as the child game object of the satellite to continuously observe the satellite at the same relative position while in motion. But when I run the game, the satellite shakes badly. The global volume does not have motion blur turned on, and the background of the scene does not shake. My thoughts are this is because of float type accuracy errors, since the planet has a radius of 6378100, and the satellite is at 500000 altitude, but I am doughting myself because the main camera is the child of the satellite and they should move together. Seeking your help if you have any solutions to this, thanks!
     
  2. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    This is a component that is not part of our expertise, so you might find greater experts in the Graphics domain in this section of the forum
     
  3. Homicide

    Homicide

    Joined:
    Oct 11, 2012
    Posts:
    657
    Two things that instantly come to mind are, A; As you mentioned, issues with the sheer size and distance you are attempting to utilize, and B: where exactly is the movement taking place for the object the camera is bound to?

    Just speaking from personal experiences here, but camera movements made anywhere outside of the lateupdate can often cause jittery undesireable motion. Perhaps try moving the movement code into a late update, before diggin deeper into the much more problematic floating point problem.

    GL