0 votes

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.

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

in Engine by (96 points)

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()
    print(str(player_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")
    the_root.add_child(new_enemy)
    new_enemy.set_global_pos(new_pos)
    parent.queue_free()

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

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.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to we[email protected] with your username.