How do you flip everything within a camera accross the y axis?

Godot Version

4.5.1

Question

I have my camera attached to my player and I want everything on screen aside from the HUD to get flipped horizontally when I trigger an effect without changing the position of everything.

The solutions I’ve found so far are out of date for the newer versions of godot. Changing the camera scale.y to -1 does nothing. Changing the camera scale.x to -1 does nothing unless the rotation isn’t locked and then it rotates the entire camera 180 degrees (flips both x and y) even if scale.y is positive.

Viewport.render_target_v_flip is no longer a thing.

Is there something I can do with the viewport to flip the screen horizontally?

Otherwise, is there a way I can add a shader that would give this effect? I’m not too familiar with shaders or how I can have it impact specifically what this camera sees.

Parent everything to a canvas layer node, set its vertical offset to half of the vertical resolution and its vertical scale to -1

Thanks for the quick reply!

This had close to the desired effect. Ran into troubles with following the player while reflecting.

At first the Follow Viewport did nothing. Then after a restart it would center and track the viewport but the follow didn’t account for the flipped scale.

Come to find out after 3 hours that the camera zoom is what needs changed, not the scale.

Solution: set camera’s zoom to (-1.0, 1.0).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.