Godot Version
4.5.1
Question
I’m wondering if there’s a neat way to take the body passed to a method like Area3D.body_entered() and figure out what is the scene is that it is a child of?
Many times when I’m creating a complex game object, I’ll set it up so that there is a Node3D at the root and one or more CharacterBody3D or RigidBody3D nodes as children (especially a system of RigidBody3D connected by joints). However, only the physics bodies are passed to the detector methods. Right now I’m determining what the “container” object is by recursively getting the parent and checking if it’s a class_name I assigned - but this seems inelegant to me.
Is there a simpler way to take the body passed into a collision or area sensor and figure out the scene that contains it?