When using 3d nodes as child of subviewport, how to get the input_events?

Godot Version

4

Question

I’m not understanding well what I am doing.

I have a setup my game as in godot-demo-projects/viewport/3d_scaling at master · godotengine/godot-demo-projects · GitHub

That is a SubViewport inside SubViewportContainer, and the "Node3D"s are all inside that.
I used to not have this, and just had the Main Node3D, and the UI as a sub item, and I reversed it to be like that demo, so the Main is now a “child” of the Control nodes.

But I used to have input_event.connect(_on_input_event).
And now they don’t work.

On the demo project there was no additional configuration on the viewport. Do I need to add some checkboxes?

1 Like

The way to pass the click events seems to be:

image

and the parent, SubViewportContainer must be on Filter:Stop mouse events

I’m having similar issues with a first person character controller.

If I place my player character controller inside of a Subviewport, my mouse look simply doesn’t work, and I’m not sure what to do to get it to work.

If I only place the camera within a subviewport, then any other references to the child nodes of the camera node break (read as null).

I haven’t found a good explanation on how the subviewport actually works or handles it’s child nodes so I could make this work again.

Did you ever find a solution to this issue? I’m finding it impossible to make mouselook in my player controller function. My main menu works, but the moment I load a scene (Subviewport Container > Subviewport > Node3D > Scene) mouse look is non functional, walking still works. If I do the above and set SVC filter to stop it breaks my main menu inputs aswell.