Finding the rotation of a volume

I’m trying to calculate how close the player is to the edge of a volume and i need to know the rotation so i can work out the distance between the player and the edge of the volume. I have the math worked out to do this but i cannot get the rotation of the volume. I’ve tried getting the actors rotation, the brush component rotation, and the RootComponent rotation. All of them are returning zero rotation on all three axis. So the question is, how do i find the rotation of a volume?

– John

Hi Johnathan,

Thank you for your report. Based on what you are describing, it sounds like you are experiencing this error:

https://rocket.unrealengine.com/questions/12751/i-cant-use-getactorrotation-in-controllers-bluepri.html

Kazuhisa has reported success with a work around using “Get Actor Transform” then using a “Break Transform” to get the proper rotation data. Please let me know if this is not the case and I will be happy to assist you further.

Thank you,

Alexander

Alexander,

I tried that and got nothing from it. still getting all zero's.  Also i'm trying to do this in C++.

Thank you,
–John

After discussing this issue with another developer, we came to the conclusion that you can retrieve rotation values applied to the volume after start, but it requires a work-around.

What seems to happen is the brush is created and the vertices transform to their final positions before the actual volume is ‘finalized’, so the actor’s rotation values exist only while in-editor, the actual object in-game is the collapsed application of those values to the associated vertices. If you attach a volume to an intermediate component (like a cube mesh), and only rotate the volume using said component, retrieving the parent object’s rotation will give you the correct rotation values for the volume. Also, any rotation applied AFTER the game starts can be retrieved by getting either the object or the brush component’s rotation like you would any other actor.

I hope that this work around has helped to resolve the issue.

Cheers!

Alexander