What does this warning mean: Node was modified from inside an instance, but it has vanished.

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

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?

Also having this error…

jarlowrey | 2019-03-08 04:41

:bust_in_silhouette: Reply From: jarlowrey

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.

:bust_in_silhouette: Reply From: whiteshampoo

Sorry for bringing this up 1 years later.

I had the same problem. I looked in the scenes tscn-file with the editor. Looks like it saved the file wrong.

I open the file in the editor, and right-click the tab → save-file so overwrite the tscn file again.
Then it was working.

Hope this work for you all, too!

Thanks for the tip. I was getting this error when I deleted nodes from the parent node and had made modifications to those nodes in the children. So I had to go into each child tscn file and remove the reference to the deleted node.

NaughtyGnosiophile | 2021-04-02 08:47