x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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: alt text

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. alt text

This is the hierarchy of my player pawn components. Ignore the other capsule.

alt text

I feel like I'm overlooking some simple thing. Any help would be greatly appreciated!

Product Version: Not Selected
Tags:
more ▼

asked Apr 11 '19 at 07:34 PM in VR

avatar image

Kami822
19 2 4 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Apr 12 '19 at 01:20 PM

avatar image

christopheraugustus
26 1 3

avatar image Kami822 Apr 12 '19 at 07:16 PM

Making the corrections to the first blueprint image worked, thanks a lot for explaining!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question