Crash. "Condition ' ResourceCache::resources.has(p_path) ' is true."

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By equus

Hello! I’m getting an error and I have no idea why. I don’t remember what parts of code I changed and the error trace doesn’t show any information to me. Nevertheless I can run the code but sometimes it crashes randomly. The editor keeps working.

I don’t know what parts of code I must post here so I will only post the error.

Godot version: 2.1.4

The error is: Condition ’ ResourceCache::resources.has(p_path) ’ is true.

I commented this part of code and the error was not showing anymore:

func _on_life_create_enemy_common():
	var player = get_node("/root/Node/PlayerRoot/KB2D")
	var player_pos = player.get_global_pos()
	var new_pos = player_pos
	new_pos.y -= 100
	var new_enemy = preload("res://scenes/3_3/enemy_common.tscn")
	new_enemy = new_enemy.instance()
	var the_root = get_node("/root/Node")

What could cause the error above?
But the player keeps crashing. I will look to my code again.

equus | 2018-03-12 21:20

I found the reason why godot crashes. It was not a crash. I was freeing the node that owns all the other nodes. But I still thinking what caused the ResourceCache error.

equus | 2018-03-13 00:06