Toai_i
(Toai_i)
May 26, 2025, 1:12pm
1
If i set the Yaw Rotation value of an object in the editor to 45°.
How can i get that 45° yaw value with verse?
Object.GetTransform().Rotation.X
Object.GetTransform().Rotation.Yaw
something like this wont work.
Someone knows how to get the yaw value of the object?
btwixer
(btwixer)
May 26, 2025, 1:31pm
2
Use GetYawPitchRollDegrees() on the rotation which will return a vector3{} with the values.
Here’s an example of checking Yaw (ignore xy_dir, that’s my own thing).
Rot_To_XYDir(pRot : rotation) : xy_dir =
aYPR := pRot.GetYawPitchRollDegrees()
if (aYPR[0] < 45.0):
# Yaw less than 45 degrees
There’s a version that return Radians I think too.
Toai_i
(Toai_i)
May 26, 2025, 5:50pm
3
Thanks a lot for the answer. I was expecting to always get the values from the editor, but the differ.
Yaw = 90°, Pitch = -90°, Roll = 0°
give me the exact value back
Yaw = 45°, Pitch = -90°, Roll = 0°
I get those, which are different:
Yaw = 26.565°, Pitch = -90°, Roll = 18.43°
Maybe Im missing some important detail. Any idea how to get those exact values back?
aYPR := TriggerH.GetTransform().Rotation.GetYawPitchRollDegrees()
if(Yaw := aYPR[0]):
Print("Yaw {Yaw}")
if(Pitch := aYPR[1]):
Print("Pitch {Pitch}")
if(Roll := aYPR[2]):
Print("Roll {Roll}")
btwixer
(btwixer)
May 26, 2025, 6:54pm
4
I don’t know what causes that, unless they are world versus relative coordinates maybe, or the object moved (rotated) after it was set in the editor.
I’ve not seen it be inaccurate in the things I’ve done so far.
Toai_i
(Toai_i)
May 27, 2025, 7:27pm
5
Hmm to bad, not sure why my behaves like that. Couldn’t fix my issue yet.
I still mark ur answer as the solution, it might be the solution for many other related things.
Thanks for helping.
btwixer
(btwixer)
May 27, 2025, 9:13pm
6
You’re showing it in the editor, is it a creative prop then? And you’re sure it hasn’t moved in the world by the time the Verse code runs?
Did you check what the world and relative rotations are - just in case one of the two is what Verse shows?
I’m trying to think of possible explanations.