Godot 4.6: Clicking the Visibility Toggle shifts the entire view to the center. How can this be prevented?

Hi!

I don’t know if this is a bug or a feature I didn’t figure out, but since version 4.6, when I toggle the node visibility, my current viewport moves toward the center (global position 0,0).

This is kind of annoying, because the element I hide or unhide is often not in that exact spot. Is there a hidden button to keep the focus on the current scrolled in view?

You can possibly get around this by modifying your elements Modulate. More specifically, it’s alpha value, and maybe disabling input handling too.

I think I expressed myself incorrectly:

When I’m working in the level editor, let’s say 10,000 pixels to the right, and I turn the eye on/off (node visibility in the Scene inspector), the whole view jumps back to 0.0 and I have to use the mouse to move my view back to the right. Is there a bug that causes it to jump back to 0.0?

1 Like

Can anyone confirm if this is a bug?

Yep, can confirm, it’s a bug introduced in version 4.6.stable (I am using Steam version).

The node that is selected will get focused on node’s global position in editor when clicking visible twice in a short time (not just 0, 0). But usually I do this for TileMapLayer(s) sense I work with 8 of them. Those are at 0, 0 position (center).

Reason why I do the visible / invisible toggle for layers: that will make the work easier for me to see the difference between layered tiles or any other reason.

Today there was an update 4.6.1 and the issue still persists, but now you can have basic node selected (grey circle) in scene and toggle eye ON / OFF fast and the editor view of any other node won’t get to the 0,0 position or any other node’s global position.

Alternatively you can wait around 3 seconds before clicking the eye icon again after clicking it once, that also prevents the editor view to jump to the nodes position.

Hope it will be fixed in the next update..

1 Like

If this is indeed a bug, I recommend creating a MRP and creating an issue on GitHub. Otherwise it might not be fixed since many people might not rely on this workflow, and might not even encounter this.

2 Likes

I think it was fixed in Fix camera focus triggered by double-clicking Tree buttons by mxtherfxcker · Pull Request #114519 · godotengine/godot · GitHub

1 Like

Thank you for the information.