Holster System: Issue with Rotate in Place for Player (Using Motion Controller Pawn)
I am having problems with my holster system being offset whenever I rotate the VR player pawn in place. Keep in mind that I mean using a button to turn left or right by 45 degrees, not turning in place physically in real life. To clarify further, initially I would have my holstered weapons facing exactly forward relative to the player camera but when I rotate the player pawn in place by 45 degree increments, the holstered weapons have an additional 45 degree increment so turning left makes my holsters 45 degrees counterclockwise from forward facing. Continuing to rotate in that direction will offset further (two rotations to the left will make the holsters face 90 degrees to the left relative to the player pawn/camera).
The holster system is currently just scene components attached to the player capsule which itself rotates if the player camera rotates.
This image shows how my rotation capsule follows the player VR camera via event tick:
Rotating the player pawn via the left or right hotkey by 45 degrees as shown in this picture below should rotate the rotation capsule and thus the holsters which are attached to the rotation capsule by the same amount since they're all child to the player pawn. I thought the solution was simple: you can see on the right that I tried to offset the rotation capsule back by 45 degrees so they simply re-aligned again but this didn't do anything. Neither does offsetting the camera back the same amount do anything.
This is the hierarchy of my player pawn components. Ignore the other capsule.
I feel like I'm overlooking some simple thing. Any help would be greatly appreciated!
In the first blueprint image your are setting the RotationCapsule RELATIVE rotation from the camera WORLD rotation. So that by itself will be wrong in many scenarios, assuming VROrigin ever changes its Z yaw value from 0.
In the second image, AddActorLocalRotation will turn actor root scene component VROrigin, so then you are turning the RotationCapsule which is a child of it an additional constant 45 degrees beyond the RotateAmountLeft/Right that VROrigin is getting.
You shouldn't have to change rotation on RotationCapsule at all unless you want it to rotate with the Camera and not the body (VROrigin). If you want RotationCapsule to match the yaw (and not looking up or tilting head) of the Camera, then just copy the Camera RELATIVE rotation Z value to the RotationCapsule RELATIVE rotation Z value on every tick--i.e. just make the first correction to the first blueprint image.
Follow this question
Once you sign in you will be able to subscribe for any updates here