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"

VR: Rotate player's view on rotating platform

Hi there,

In my current example, the player can walk over a slowly rotating platform, so it's current viewing angle should change accordingly like in real life. This works well in non-VR.

In VR, however, the current viewing angle seems 1:1 mapped to the headtracking-data. So the platform rotates but the player is continuously facing the SAME direction (which is wrong of course).

I currently fixed this by checking if the player is currently standing on the platform and in this case manually adding the current yaw difference per 'add yaw input' and multiplying the value with 0.4 (for whatever reason) if in VR-mode:

alt text

How to do it the proper way? Thank you! :)

Engine Version: 4.7.3

Product Version: Not Selected
Tags:
more ▼

asked Mar 21 '15 at 02:41 PM in Blueprint Scripting

avatar image

spyro
1.7k 106 117 232

avatar image spyro Mar 30 '15 at 06:09 PM

So, can you at least confirm that this is a bug...?

EDIT: Hello...?

avatar image spyro Apr 09 '15 at 01:07 PM

Ok, after a few days of fiddeling around I at least found the reason for the weird scale factor of 0.4:

UE4s default player controller scales all yaw values with 2.5 for whatever reason which screws up pretty much all rotation commands in my project.

Solution:

  • Create a new BP and derive from "PlayerController".

  • Change "Input Yaw Scale" to 1.0 (instead of 2.5)

  • Set this Blueprint as 'player controller class' in the world settings of your project or alternatively in your active GameMode

I still have to manually add the rotation of the platform under the player to the yaw of the camera...

spyro

avatar image spyro Jun 30 '15 at 09:08 AM

Update: Still not fixed in 4.8.1, created and uploaded a test project: https://mega.co.nz/#!HVIknb5C!gyAxhxoPr4PJO9jxCD6WBVC0nlYZpA9b1-mYYziemoo

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

2 answers: sort voted first

This is how your blueprint should look like (4.8.x) to make camera to follow the platform's rotation:

alt text

 Begin Object Class=K2Node_Event Name="K2Node_Event_255"
    Begin Object Class=EdGraphPin Name="EdGraphPin_678"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_679"
    End Object
    Begin Object Name="EdGraphPin_678"
       PinName="OutputDelegate"
       Direction=EGPD_Output
       PinType=(PinCategory="delegate",PinSubCategoryMemberReference=(MemberParent=Class'/Script/Engine.Actor',MemberName="ReceiveBeginPlay"))
    End Object
    Begin Object Name="EdGraphPin_679"
       PinName="then"
       Direction=EGPD_Output
       PinType=(PinCategory="exec")
       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_3224.EdGraphPin_684'
    End Object
    EventReference=(MemberParent=Class'/Script/Engine.Actor',MemberName="ReceiveBeginPlay")
    bOverrideFunction=True
    Pins(0)=EdGraphPin'EdGraphPin_678'
    Pins(1)=EdGraphPin'EdGraphPin_679'
    NodePosX=464
    NodePosY=-1728
    NodeGuid=B837783E41394CD92756D485295CF53D
 End Object
 Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_3224"
    Begin Object Class=EdGraphPin Name="EdGraphPin_684"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_685"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_686"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_687"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_688"
    End Object
    Begin Object Name="EdGraphPin_684"
       PinName="execute"
       PinType=(PinCategory="exec")
       LinkedTo(0)=EdGraphPin'K2Node_Event_255.EdGraphPin_679'
    End Object
    Begin Object Name="EdGraphPin_685"
       PinName="then"
       Direction=EGPD_Output
       PinType=(PinCategory="exec")
       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2275.EdGraphPin_20221'
    End Object
    Begin Object Name="EdGraphPin_686"
       PinName="self"
       PinFriendlyName="Target"
       PinToolTip="Target\nOculus Function Library Reference"
       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/OculusRift.OculusFunctionLibrary')
       DefaultObject=Default__OculusFunctionLibrary
       bHidden=True
    End Object
    Begin Object Name="EdGraphPin_687"
       PinName="bFollowHmdOrientation"
       PinToolTip="Follow Hmd Orientation\nBoolean\n\n(in) True if camera\'s orientation should be updated by most recent HMD orientation."
       PinType=(PinCategory="bool")
       DefaultValue="true"
       AutogeneratedDefaultValue="false"
    End Object
    Begin Object Name="EdGraphPin_688"
       PinName="bFollowHmdPosition"
       PinToolTip="Follow Hmd Position\nBoolean\n\n(in) Whether the camera\'s position should be updated by most recent HMD orientation or not."
       PinType=(PinCategory="bool")
       DefaultValue="true"
       AutogeneratedDefaultValue="false"
    End Object
    FunctionReference=(MemberParent=Class'/Script/OculusRift.OculusFunctionLibrary',MemberName="EnablePlayerCameraManagerFollowHmd")
    Pins(0)=EdGraphPin'EdGraphPin_684'
    Pins(1)=EdGraphPin'EdGraphPin_685'
    Pins(2)=EdGraphPin'EdGraphPin_686'
    Pins(3)=EdGraphPin'EdGraphPin_687'
    Pins(4)=EdGraphPin'EdGraphPin_688'
    NodePosX=656
    NodePosY=-1728
    NodeGuid=FD8126CD49F2DE30234051AE6382A888
 End Object
 Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_2275"
    Begin Object Class=EdGraphPin Name="EdGraphPin_20221"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_20222"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_20223"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_20224"
    End Object
    Begin Object Name="EdGraphPin_20221"
       PinName="execute"
       PinType=(PinCategory="exec")
       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_3224.EdGraphPin_685'
    End Object
    Begin Object Name="EdGraphPin_20222"
       PinName="then"
       Direction=EGPD_Output
       PinType=(PinCategory="exec")
       LinkedTo(0)=EdGraphPin'K2Node_VariableSet_38.EdGraphPin_20245'
    End Object
    Begin Object Name="EdGraphPin_20223"
       PinName="self"
       PinFriendlyName="Target"
       PinToolTip="Target\nOculus Function Library Reference"
       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/OculusRift.OculusFunctionLibrary')
       DefaultObject=Default__OculusFunctionLibrary
       bHidden=True
    End Object
    Begin Object Name="EdGraphPin_20224"
       PinName="bEnable"
       PinToolTip="Enable\nBoolean"
       PinType=(PinCategory="bool")
       DefaultValue="false"
       AutogeneratedDefaultValue="false"
    End Object
    FunctionReference=(MemberParent=Class'/Script/OculusRift.OculusFunctionLibrary',MemberName="EnablePlayerControllerFollowHmd")
    Pins(0)=EdGraphPin'EdGraphPin_20221'
    Pins(1)=EdGraphPin'EdGraphPin_20222'
    Pins(2)=EdGraphPin'EdGraphPin_20223'
    Pins(3)=EdGraphPin'EdGraphPin_20224'
    NodePosX=1008
    NodePosY=-1728
    NodeGuid=6F53EAD34BFD37EB5A064EAD82817DC4
 End Object
 Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_2276"
    Begin Object Class=EdGraphPin Name="EdGraphPin_20225"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_20226"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_20227"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_20228"
    End Object
    Begin Object Name="EdGraphPin_20225"
       PinName="self"
       PinFriendlyName="Target"
       PinToolTip="Target\nGameplay Statics Reference"
       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.GameplayStatics')
       DefaultObject=Default__GameplayStatics
       bHidden=True
    End Object
    Begin Object Name="EdGraphPin_20226"
       PinName="WorldContextObject"
       PinToolTip="World Context Object\nObject Reference"
       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/CoreUObject.Object')
       bHidden=True
    End Object
    Begin Object Name="EdGraphPin_20227"
       PinName="PlayerIndex"
       PinToolTip="Player Index\nInteger"
       PinType=(PinCategory="int")
       DefaultValue="0"
       AutogeneratedDefaultValue="0"
    End Object
    Begin Object Name="EdGraphPin_20228"
       PinName="ReturnValue"
       PinToolTip="Return Value\nPlayer Camera Manager Reference"
       Direction=EGPD_Output
       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.PlayerCameraManager')
       LinkedTo(0)=EdGraphPin'K2Node_VariableSet_38.EdGraphPin_20248'
    End Object
    bIsPureFunc=True
    FunctionReference=(MemberParent=Class'/Script/Engine.GameplayStatics',MemberName="GetPlayerCameraManager")
    Pins(0)=EdGraphPin'EdGraphPin_20225'
    Pins(1)=EdGraphPin'EdGraphPin_20226'
    Pins(2)=EdGraphPin'EdGraphPin_20227'
    Pins(3)=EdGraphPin'EdGraphPin_20228'
    NodePosX=1024
    NodePosY=-1584
    NodeGuid=61BDC75B4FF9F4CC59DDD29A159A36E7
 End Object
 Begin Object Class=K2Node_VariableSet Name="K2Node_VariableSet_38"
    Begin Object Class=EdGraphPin Name="EdGraphPin_20245"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_20246"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_20247"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_20248"
    End Object
    Begin Object Class=EdGraphPin Name="EdGraphPin_20249"
    End Object
    Begin Object Name="EdGraphPin_20245"
       PinName="execute"
       PinType=(PinCategory="exec")
       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2275.EdGraphPin_20222'
    End Object
    Begin Object Name="EdGraphPin_20246"
       PinName="then"
       Direction=EGPD_Output
       PinType=(PinCategory="exec")
    End Object
    Begin Object Name="EdGraphPin_20247"
       PinName="bFollowHmdOrientation"
       PinType=(PinCategory="bool")
       DefaultValue="true"
       AutogeneratedDefaultValue="false"
    End Object
    Begin Object Name="EdGraphPin_20248"
       PinName="self"
       PinFriendlyName="Target"
       PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.PlayerCameraManager')
       LinkedTo(0)=EdGraphPin'K2Node_CallFunction_2276.EdGraphPin_20228'
    End Object
    Begin Object Name="EdGraphPin_20249"
       PinName="Output_Get"
       PinToolTip="Retrieves the value of the variable, can use instead of a separate Get node"
       Direction=EGPD_Output
       PinType=(PinCategory="bool")
       DefaultValue="false"
       AutogeneratedDefaultValue="false"
    End Object
    VariableReference=(MemberParent=Class'/Script/Engine.PlayerCameraManager',MemberName="bFollowHmdOrientation")
    SelfContextInfo=NotSelfContext
    Pins(0)=EdGraphPin'EdGraphPin_20245'
    Pins(1)=EdGraphPin'EdGraphPin_20246'
    Pins(2)=EdGraphPin'EdGraphPin_20247'
    Pins(3)=EdGraphPin'EdGraphPin_20248'
    Pins(4)=EdGraphPin'EdGraphPin_20249'
    NodePosX=1328
    NodePosY=-1712
    NodeGuid=9B492EC64BC38A16C2D1FBA2B938EC82
 End Object
 


more ▼

answered Jul 01 '15 at 05:47 AM

avatar image

Art_Oculus
191 2 5 15

avatar image spyro Jul 01 '15 at 10:29 AM

Perfect, thank you!!

avatar image MorskoyZmey Sep 01 '15 at 10:19 PM

Don't get why we need all these nodes except last one? And why we are enabling follow HMD orientation? I know it works but don't get why that flag has inverted logic?

avatar image spyro Sep 02 '15 at 08:27 AM

Long story short: It's pretty much broken right now. See https://forums.oculus.com/viewtopic.php?f=60&t=24683 for reasons.

Currently, we can't do much than vote for https://trello.com/c/lIl9cs7l/512-camera-refactor

spyro

avatar image Johannski Nov 21 '15 at 10:45 PM

Hi there, Thanks for the solution. Sadly it creates an error in Unreal 4.10 once you package the project or reopen it. Se the Screenshot for details: alt text

Once I remove the blueprint everything works fine again. I use unreal 4.10 and the Oculus SDK 0.8.0.0. Does anyone have a solution for the problem?

second.png (140.7 kB)
avatar image Art_Oculus Nov 21 '15 at 10:49 PM

You need to recreate that blueprint manually using the blueprint editor rather than pasting that text. Seems like pasting may work only while you stay on the same version of UE.

avatar image Johannski Nov 22 '15 at 08:06 AM

Thanks for the superfast answer. I did recreate it by manually building it with the blueprint editor. Do you have any other suggestions?

avatar image Art_Oculus Nov 22 '15 at 10:20 AM

Just tried it and it works for me.... alt text

aaa.png (186.1 kB)
avatar image Johannski Nov 25 '15 at 09:55 AM

Thanks again for the answer! I did a bit of testing and found out, that the problem I described occurred when you use the first person c++ template. With the blueprint template it works. Not sure if that can be considered a bug or if I really just shouldn't mix C++ with blueprints.

avatar image spyro Nov 25 '15 at 02:55 PM

... or maybe the long-awaited camera-refactoring should finally be implemented. This was done by Oculus many months ago but rejected by Epic: https://forums.oculus.com/viewtopic.php?f=60&t=24683#p283597

Seriously, is there any none left who fully understands all the different working, partially- and non-working rotation-options? AFAIK followHmdPosition still doesn't work in the camera manager.

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

[Unreal 4.11]

For the new unreal version, this solution doesn't work anymore. I found a clean way to do it anyways:

First, deactivate "Lock to HMD" in the camera you are using. alt text Now, whenever you want to rotate the HMD you have to use the function "Set Base Rotation and Base Offset in Meters" with the parameter rotation... obviously. alt text

I hope this saves some stress for someone upgrading to the new version :)

more ▼

answered Feb 08 '16 at 01:12 PM

avatar image

Johannski
1 1 2

(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