Timer node crashes Godot (Ineditor)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lavaduder
:warning: 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

:bust_in_silhouette: Reply From: eons

Tools run in the editor, you are running a tool that deletes itself in-editor.

Is ok what you see, the crash may be produced because the loaded scene removes the root inside the editor as you wanted with that code.