Sorry if this has been cover, but after 2 weeks of searching I can’t find a answer. I’m trying to use a simple “Cast to” in a BP to get variable & change stuff between MotionController & MotionControllerPawn. I thought I would be able to use GetController or GetControlledPawn to give me the reference to cast to the other one. But it does not work. How is everyone else solving this issue ?
I guess you are referring to the standard VR template. Here is how it works. MotionControllerPawn is your VR Pawn. When the Pawn is created (on Begin Play) it spawns two instances of MotionController_BP, one for the Left hand and one for the Right hand, and attached them to the MotrionControllerPawn. The MotionController_BP contains, among other components, a Motion Controller component, which is the link the the physical motion controller for your system (if you have an Oculus, that would be the Touch controller).
In short, MotionControllerPawn and MotionController_BP are two different BP’s and they don’t inherit one from the other so you cannot cast between them.
Thanks Marco for the explanation. Yes I’m referring to the standard VR template. This seems like a difficult way to do the VR setup as I have many situation where I need to know who the VR Pawn that owns the hands that just interacted with something. Do most people use the VR template or is there another preferred VR setup ? Or is it possible to change it and save a reference to the controller when I attach them on being play ?