Hello, I am asking for help about a problem in the game I'm working on. Basically I have an Area2D node with many child nodes, one of those being a CollisionShape2D node. When a certain event is triggered, I need the CollisionShape2D node to stop functioning but I need everything else to stay as normal for a short period before it's queue_free'd. I've tried remove_child(CollisionShape2D) but it doesn't recognize that as a node for some reason. Any ideas on what I can do?

  • DaveTheCoder replied to this.
  • Yes, you would use remove_child() but with a reference to the name of the child. It is a good idea to name your nodes something that makes sense. So if you name that node "collision" you can do this:

    var collision = get_node("collision")
    remove_child(collision)

    Yes, you would use remove_child() but with a reference to the name of the child. It is a good idea to name your nodes something that makes sense. So if you name that node "collision" you can do this:

    var collision = get_node("collision")
    remove_child(collision)

      WolfgangS When a certain event is triggered, I need the CollisionShape2D node to stop functioning

      This may not help in your situation, but setting a CollisionShape2D's disabled property to true will stop collisions from being detected.