Download

How does the template make the hands follow the controllers?

I’ve been doing a lot of changes to the template and without batteries I was unable to test for a few days. Now I have batteries and only the RightController instance of BP_MotionController follows the controller. I’m looking at the base template in another project that works and I just can’t find anything in the blueprints related to this behaviour, so have no clue how I could fix it in my custom version.

Edit: It looks like it’s handeled in the construction script for BP_MotionController where MotionSource is set based on the value of Hand, but I can’t find where that value is assigned for each instance. There’s no reference to blueprints for MotionControllerPawn and even though it’s public and instance editable, it’s not listed in the details section.

Second Edit: Turns out the default value for this variable in the normal template is “Left” while in my project it somehow got changed to “EController Hand MAX” which isn’t even one of the options in the enum. Either way, I set it to Left and it works. Would still like an explanation however.

Each Motion Controller Component has an associated motion source, usually Right for the right hand and Left for the left hand (but there are more). The motion source is what the controller synchronizes with for location and rotation. The location and rotation of the motion source come from the physical device associated with it (in the case of the Oculus the Oculus Touch Controllers).

The MotionControllerPawn spawns one BP_MotionController object for each hand. One of the variables exposed on spawn is the Hand, which is then used to assign the proper motion source for each controller. This takes place in the Construction Script for the BP_MotionController. Have a look in it and you will see the assignment.

1 Like