Download

Rotate scene around player?

I’m trying to make a blueprint that will rotate the scene around the player’s current position when pressing the R trigger.

“Set World Rotation (Scene)” does apply a rotation, but it rotates around the scene origin, which is not the player’s current location, so it effectively causes a translation as well that I want to avoid.

I thought that perhaps I might need to first “Set World Origin Location” to the players position every time I want to rotate, but because it only accepts an int-vector, there would be a precision loss in converting from float that I want to avoid.

It seems that a better solution would be to use “Set World Location and Rotation” which does accept a floating point location value. However, whenever I try to use either SetWorldLocationAndRotation or SetWorldOriginLocation, I get the following error:


Error Blueprint Runtime Error: Accessed None trying to read property CallFunc_GetPlayerCharacter_ReturnValue from function: 'ExecuteUbergraph_VR_Pawn' from node: Set World Origin Location in graph: EventGraph in object: VR_Pawn with description: Accessed None trying to read property CallFunc_GetPlayerCharacter_ReturnValue

Any ideas?

Well, you would need to do the math to rotate it around the player instead of around its own origin. Why are you rotating the scene instead of the player?

Because “Set Control Rotation”, “Set World Rotation,” “Set Actor Rotation,” etc, all seem to have no effect whatsoever…probably due to the way that HMD integration is done in SteamVR. I don’t know?

Anyway, after much blood sweat and tears, I FINALLY did manage to accomplish rotation of the scene about player location, it works like this (simple 180 degree flip for example):

As long you rotate whatever the camera is parented to it should work fine. Yo can’t rotate the camera because it is having its transform set from the HMD.