- Edited
I've been in an incredible amount of confusion trying to get nathan hoads dialogue manager to work with my project, and I've just found out what was causing me so much trouble. But I don't have a strong understanding of why and if this should be considered expected behavior.
Here are three configurations of my tests scenes:
The 'Gregor_samsa' node contains a 3d scene with a CharacterBody3d that is controlled with inputs read inside the _unhandled_input
function and the 'test_dialogue' node spawns an example dialogue bubble from dialogue manager. When the dialogue gui is onscreen it should be the first to receive the player inputs and set them as handled preventing the player character from being able to move.
This works as expected in example c. (though I had to replace some of the get_viewport().set_input_as_handled()
calls with get_tree().root.set_input_as_handled
in the example balloon script, I haven't determined why some of those fail when get_viewport()
returns a subviewport and why others seem to work as expected.)
In example b both the gui and 3d scene receive player input as unhandled input causing the player to be able to move throughout dialogue sequences.
And example a works as expected again but it bothers me that I have to use a subviewport that otherwise would be unnecessary.
Maybe I am going about something wrong, in my use case I have the 3d scene in a subviewport so that I can apply dithering to the 3d scene that shouldn't be applied to the text, then both the text and the dithering subviewport are placed inside a subviewport that is set to render at 320x240 and then stretch that resolution to a higher resolution and optionally apply crt effects.
I guess I have not experimented with using the backbuffer technique to apply the dithering before it gets scaled up... I might be onto somthing but if someone knowledgeable could explain why subviewports seem to handle input as if you've placed them at the end of the tree that would help me a lot.