popup() isn't working when being called from within _input()
popup()
isn't working on my PopupMenu node when it's an _input
function:
func _input(event):
if event.is_action_pressed("menu"):
print("pre-popup")
popup()
print("post-popup")
These print statements are working, it's just popup()
isn't. The weird thing is, popup()
works when it's in _process(delta)
function, so I don't know what that's about.
Tags :
- Gdscript
- Open Source
Tagged:
Best Answer
-
Megalomaniak Posts: 4,803
That s because popup needs to be rendered which requires the screen to update which happens in process.
You could set up a state(boolean var) which gets toggled in _input() that is checked in process and if true then popup() is called in process. Or something like that.
Answers
That s because popup needs to be rendered which requires the screen to update which happens in process.
You could set up a state(boolean var) which gets toggled in _input() that is checked in process and if true then popup() is called in process. Or something like that.
Thanks! Now I have another problem, but I'll ask that in a different thread.