Currently i have a RayCast3D node that is not following the parent transform and just stays in place. The RayCast3D node is a child within scene B, and scene B is then a child of scene A. Whenever scene A transforms, the instanced RayCast stays in place and does not follow scene A.
Every node between your Player and RayCast3D nodes need to be of type derived from the Node3D, otherwise the transform is lost. Both PlayerInventoryComponent and WeaponsManager nodes are of type Node, which don’t have the transform.
If you don’t want to change your scene’s structure, you could just copy the transform of the Player’s node to your RayCast3D node each frame, doing something like that:
that was my suspicion, though i had thought that RayCast3D had its own transforms. Thinking about it, RayCast3D gets its transform values from the base node, which has none. changing both parent nodes to Node3D has solved the issue. Thanks!
Well, it does have its own transform, every Node3D has a transform. But if it’s a direct child of a Node, its transform will be reset to Transform3D.IDENTITY, which has no translation, no rotation and a uniform scale of 1.0 and it won’t inherit any transformations from its parent’s parents.