Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | mshka | |
Old Version | Published before Godot 3 was released. |
Hello,
i have a function which add a pause_menu to the scene(instance) which is triggered by a button press or a quit request(_notification)
the function seems to run well when triggered by the button but when its triggered from the quit request the instance isn’t added to the scene…
function:
func _on_pause_button_pressed():
if(disablepause==false):
var cam_pos = get_node("Camera2D").get_pos()
var pause_menu = pause_class.instance()
pause_menu.set_pos(cam_pos)
add_child(pause_menu)
get_node("sound_effect").play("button_clicks")
pause_menu.pause_game()
_notification function:
func _notification(what):
if(what == 7 and get_tree().is_paused() == false):
_on_pause_button_pressed()
print("quit request")
i tried calling add_child on get_parent() and a specific node in the scene but it wont seem to work
I’m using Godot version 1.1 stable, is this a bug that has been fixed in the newer version or am i doing something wrong
Same error on Godot 2.0.
DriNeo | 2016-03-20 20:47