Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | lavaduder | |
Old Version | Published before Godot 3 was released. |
I set my timer node as set_one_shot(true)
. And when the timer hits 0, it queue_free()
the base node (Rigidbody2D) But now everytime I load the scene godot crashes. It gets even weirder. If the Rigidbody2D scene is loaded in another scene. It deletes it self, in the editor window!
didn’t you use tool
keyword?
volzhs | 2017-04-05 07:18
Yes i used the tool
keyword. Sorry I didn’t include that bit.
Infact I probably should have included the code that came with this whole issue.
tool
extends KinematicBody2D
var delayt = Timer.new()
export var delaydeath = 3
func _ready():
#Set up a timer node
delayt.set_name("delaytimer")
delayt.set_wait_time(delaydeath)
delayt.set_one_shot(true)
delayt.start()
set_fixed_process(true)
pass
func _fixed_process(delta):
if delayt.get_time_left() == 0:
queue_free()
pass
lavaduder | 2017-04-05 16:31