![]() ![]() This mean that the emit_signal() function is working as intended but somehow my KinematicBody2D node from another scene cannot receive the signal. extends LabelĮdited: After some testing, it seem that the emit_signal function works with the following code. So I thought the problem might be with the logic of my program so I try to run the following code and I expect an endless prints, but there is nothing in the debugging console. Which mean there is a total of three scenes - level.tscn, player.tscn and pause.tscn. The KinematicBody2D node is also inside yet another scene where it is also instanced inside the main scene. The Label node is inside another scene where it is instanced inside the main scene. " in the debugging console but there isn't. I am also expected to see "Restarting game. With this, I am expected to see the player node go back to its original position. KinematicBody2D node - player extends KinematicBody2DĬonnect("restart_game", self, "restartGame") If(event.is_action("ui_accept") & get_tree().is_paused()): Instead of giving all my codes (which is a mess), I am just going to show part of the code.Ī Label node that will appear when the user pause or lose a game. I read the tutorial here and followed the code snippet and implant it inside my project. ![]() I read about signal and I find the concept to be interesting and a good thing to add into my game. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |