Godot Version v4.2.1.stable
Question
I’ve encountered an unexpected behavior with an AnimatableBody and certain child nodes.
It’s a bit hard to explain but I’ll try my best:
I have a custom class that controls a moving Platform, based on an AnimatableBody3D.
This platform can be controlled by a button (GenericButton), also a custom class that is a child of the platform (see image). This one in this case is also derived from an AnimatableBody3D.
I want this button to move with the platform when it moves, yet here it’s where it gets complicated:
My project uses a raycast-based interaction system. Any objects that I want to interact with need to be on collision layer 2.
As I don’t want to interact with the platform node, I set it only to layer 1.
The GenericButton is on layer 1 and 2.
In game when I activate the button, the platform moves, and so does seemingly the GenericButton, except I notice that seemingly the attached COllusionShape3D of the GenericButton stays in place.
All the other objects seem to move as expected.
This behavior does NOT occur, if I set the platform’s collision to layer 1 and 2.
Unfortunately, if I set my platform like that, my system picks up the whole platform as the interaction trigger, practically making all it’s collision shapes work like the button.
Is there a way to get the GenericButton’s collision shape to move with the rest of it / not have it stay in place for some reason?
Thanks in advance!
PS: I’m ussing tweens to move the platform. And the AnimatableBody3D’s all have Sync to Physics turned on.