Reparenting Area3D Causes Weird Error

Godot Version

4.3

Question

I get this error when reparenting an Area3D

image

Harpoon.gd:32 @ _on_area_entered(): Removing a CollisionObject node during a physics callback is not allowed and will cause undesired behavior. Remove with call_deferred() instead.

You are trying to change the SceneTree node hierarchy in the middle of the physics process lock.

The error tells you what to do which is to use call_deferred() for the reparent so it is called afterwards when the lock is lifted.

1 Like

image

That fixed it, thanks man :smiley:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.