cancel
Showing results for 
Search instead for 
Did you mean: 

OVRPlayerController with Parent Transform

sirdrakko
Honored Guest
Any advice or tips on how to make OVRPlayerController support a parent transform?  I'd like the player to be on moving platforms and vehicles and still be able to walk around within that local parent's space.  Anytime I parent the OVRPlayerController to a game entity, the walk speed is incredibly slower, or if the parent is moving within world space, the OVRPlayerController seems to be inversely translated.  I suspect that's due to OVRPlayerController using Controller.Move for absolute world moving.  Anyone find a way to support this type of scenario?  I noticed some discussion around hovering platforms, but in my above scenario the transformation isn't just vertical.
1 REPLY 1

sirdrakko
Honored Guest
I've learned that this is a general limitation of Unity's CharacterController (doesn't implement rigidbody physics for character controllers), which OVRPlayerController seems roughly based on, considering it uses an absolute Controller.Move() semantics. I have a rough idea of what needs to be done, which is calculate the offset of the moving parent from the last frame and factor this into the character movement.  Also, it seems really important to calculate this within a FixedUpdate() otherwise you'll get severe jitter on vertical motion.  For the time being I'm recalculating this movement within the platform and updating the controller, but when I get more time I'll make this more intrinsic to the OVRPlayerController itself, so I can dynamically attach parent platforms as needed to calculate the offsets.

HTH someone else.