I'd like to have a dummy Viewport around a scene to make it easier to substitute when changing scenes:
> root
>> ViewportContainer
>>> Viewport
>>>> myScene: Node2D
>> UI: Control
I have a problem when passing the input to myScene
: I set the ViewportContainer
to pass input, and in the Viewport I tried:
onready var child: Node2D = get_node("myScene")
func _input(event):
child._input(event)
The _input
function is called, but I'm getting the error: Nonexistent function '_input' in base 'Node2D (myScene.gd)'
.