First off: thanks for the great base controller. It's been lovely having something to drop in for prototyping. I assume I'll customize it a bunch for our game but this has been the simplest drop-in controller I've found that actually feels good.
So this change fixes a bug I encountered whereby nested interactables were un-interactable because the interaction system assumed that the collider and the transform were the same object. In my case I had this hierarchy:
Elevator (just a kinematic rigid body)
Room (the mesh of the interior)
Button (the interactable item was here)
With the old code it saw that I was looking at the button but used the Elevator's transform because that's the transform of the rigid body itself. This change switches to tracking the collider the player is looking at and prefers interactable components on the collider over interactable components on the rigidbody.
First off: thanks for the great base controller. It's been lovely having something to drop in for prototyping. I assume I'll customize it a bunch for our game but this has been the simplest drop-in controller I've found that actually feels good.
So this change fixes a bug I encountered whereby nested interactables were un-interactable because the interaction system assumed that the collider and the transform were the same object. In my case I had this hierarchy:
With the old code it saw that I was looking at the button but used the Elevator's transform because that's the transform of the rigid body itself. This change switches to tracking the collider the player is looking at and prefers interactable components on the collider over interactable components on the rigidbody.