I preload the tscn files and main.add_child(item). How to delete this RigidBody node and its child nodes (RigidBody node with child nodes: a sprite node and a collider shape node)?
The question isn't specific to RigidBody, you might as well ask: How to delete a node and its child nodes?
- bluenote10
1 Answers
4
votes
There isn't enough info, or just incomprehensible for me, but to delete node with it children, you just need to delete the they parent node.
get_node("your_rigid_body").free()
or
get_node("your_rigid_body").queue_free()
if you want to delete it in next frame. ( I'm not sure about the second one )
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
RigidBody, you might as well ask: How to delete a node and its child nodes? - bluenote10