+4 votes

The full error:

0:00:04:0248 - Node './Crosshairs' was modified from inside an instance, but it has vanished.

Time: 0:00:04:0248
C Error: Node './Crosshairs' was modified from inside an instance, but it has vanished.
C Source: scene/resources/packed_scene.cpp:149
C Function: instance

I have a weapon class that contains an exported packed scene Crosshairs.

extends Node2D

export(PackedScene) var crosshairs
var _crosshairs

func _ready():
    _crosshairs = crosshairs.instance()

In another class, when this weapon class is instantiated, I get the warning.

extends Panel

export(PackedScene) var weapon
var _weapon

func _ready():
    if weapon == null:

    _weapon = weapon.instance()

The error happens on the line _weapon = weapon.instance()

So what does this error mean? Should I be concerned? (I hate errors.) How can I fix it?

in Engine by (34 points)

Also having this error...

1 Answer

+1 vote

I ended up having this error when I used "Change Type" on a child node of an inherited scene. I fixed it by deleting and re-creating the child.

For example


- CollisionPolygon2D

The child is created using "New Inherited Scene" and selecting the parent. So it's:

- CollisionPolygon2D
- TimerNodeAddedToChild

Now this error occurred when I right-clicked CollisionPolygon2D in the child, selected "Change Type" and made it CollisionShape2D. This appears to work in the editor, however if you check the remote inspector while running you'll see it is using the parent's original node (CollisionPolygon2D here).

The only way I could find to fix it is to delete and re-create the child scene.

by (618 points)
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 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 webmaster@godotengine.org with your username.