|Topic was automatically imported from the old Question2Answer platform.
I’ve created an Area shape on my player character that I want to use as my characters ‘grab’ area. There are going to be several different objects in my scene that my character should be able to grab. I’ve added a listener to
Area.body_entered() to keep track of when things enter grabbable range. However, I don’t know what to do with the
body:Node that is passed to my listener method.
I need to be able to determine what sort of object I’m touching. For example, if I have a door object and a chest object, both with different scripts attached to their root, how do I know if I’ve bumped into a door or a chest? Is there a way to check the object to see if it has the
openDoor() method that I’ve added to script I’ve attached to my door object?