How do I eliminate minimap camera wobble

Hi, I have a top down camera serving as a minimap camera that shows the minimap in the lower left of the scree.

This all works fine as my character walks around the environment. But…

Then the character rides/flies a giant eagle creature thing, and then as the wings flap the character bobs up and down as expected in the main camera but so does the minimap camera.

Is there a way to stop the minimap wobble so the camera is more or less 2D? viewing the character from above and staying sold above the character?

Any ideas appreciated. Im not a coder so wouldnt even know where to begin coding this if it can be done.

Any help much appreciated. Thanks

Here are the current minimap camera settings.

Where is the script which is moving the minimap camera? Or is the minimap camera a child of the player GameObject?

There is no script, the camera as you suggest is a child of the character.

Thanks for the response by the way.

Ehh, well that’s the problem then. As a child the camera is going to move up and down with the character object. You could take a few approaches to fix this. Off the top of my head, here’s 3:

  • Change the flight bobbing so it moves up and down a child GameObject which contains the character model and any colliders instead of the parent, so the character model would still appear and behave as if it were moving up and down but the parent object does not. Have the minimap be a child of the character’s parent. Doing it this way may require redesigning a lot of the movement of your character though.

  • Change the minimap camera so it moves by its own script instead of being a child of the character, and have the minimap camera stay at a fixed height above the character. The script would be pretty simple, just in LateUpdate set the minimap camera’s transform.rotation to that of the characters, and the position to that of the character’s x and z, but a fixed y position. This won’t be a good approach if your game has terrain of different heights.

  • As part of this flight bobbing, somewhere you’re applying the downward/upward movement to the character’s Y position. Just apply the exact opposite movement to the minimap camera while keeping it a child of the character. So if the bobbing effect this frame moves the character down by a Y of 0.2, you adjust the minimap camera up by 0.2. A potential problem is over probably a long period of time you may notice an up or down drift in the minimap camera due to inherent floating point math inaccuracy issues. You can probably correct for that issue by resetting the minimap camera’s Y position whenever the character stops flying.

1 Like

Awesome, thanks Joe-Censored.

Im backing up at present so am stuck for now but will give this a go later.

Many thanks. Much appreciated for the insights.