# getyawpitchrolldegrees is failing silently

**URL:** <https://forums.unrealengine.com/t/getyawpitchrolldegrees-is-failing-silently/1151193>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [May 1, 2023, 9:58pm UTC](https://forums.unrealengine.com/t/getyawpitchrolldegrees-is-failing-silently/1151193 "2023-05-01T21:58:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![InsanePete](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/insanepete/32/641314_2.png) [@InsanePete](https://forums.unrealengine.com/u/InsanePete)\
**Post date:** [May 1, 2023, 9:58pm UTC](https://forums.unrealengine.com/t/getyawpitchrolldegrees-is-failing-silently/1151193/1 "2023-05-01T21:58:27Z")

</div>

I’ve been having trouble with rotation not doing what I expect, so I made a simple test device to experiment with it and understand the properties of this implementation better.  
I’m stuck at the first hurdle though, because GetYawPitchRollDegrees is silently failing and I don’t know how to find out why.  
Here’s my code & set-up:

- I dragged a Log03 from the Content Browser to the game area, ensured it has zeroed rotation
- I created a Verse script rotation\_test, compiled it, then dragged the device to the game area too, set to run on start, hidden
- I linked the Script to the Prop as an @editable creative\_prop

```auto
rotation_test := class(creative_device):
    @editable Prop : creative_prop = creative_prop {}

    var StartPos : vector3 = vector3{}
    var DefaultRot : rotation = rotation {}
    var DefaultYPR : [] float = array {}

    OnBegin<override>()<suspends>:void=
        Print("Start rotation_test")
        T := Prop.GetTransform()
        set StartPos = T.Translation
        Print("start position {StartPos.X},{StartPos.Y},{StartPos.Z}")
        set DefaultRot = T.Rotation
        Print("start rotation {ToString(DefaultRot)}")
        spawn{ Update() }
        

    Update()<suspends>:void=
        loop:
            Sleep(3.0)
            T := Prop.GetTransform()
            if (DefaultYPR = DefaultRot.GetYawPitchRollDegrees()):
                Print("got default rotation YPR")
            else:
                Print("could not get default rotation YPR")
            if (Yaw := DefaultYPR[0], Pitch := DefaultYPR[1], Roll := DefaultYPR[2]):
                Print("Default rot {Yaw},{Pitch},{Roll}")
            else:
                Print("could not get default YPR")

```

The output log contains:

```auto
[2023.05.01-21.46.18:805][184]LogVerse: : Start rotation_test
[2023.05.01-21.46.18:805][184]LogVerse: : start position -3112.000000,4604.000000,11514.759663
[2023.05.01-21.46.18:806][184]LogVerse: : start rotation Axis: {x=1.000000,y=0.000000,z=0.000000} Angle: 0.000000
[2023.05.01-21.46.21:822][546]LogVerse: : could not get default rotation YPR
[2023.05.01-21.46.21:822][546]LogVerse: : could not get default YPR
[2023.05.01-21.46.24:822][906]LogVerse: : could not get default rotation YPR
[2023.05.01-21.46.24:822][906]LogVerse: : could not get default YPR

```

How can I track down the problem?

---

<div class="post-metadata">

**Author:** ![InsanePete](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/insanepete/32/641314_2.png) [@InsanePete](https://forums.unrealengine.com/u/InsanePete)\
**Post date:** [May 1, 2023, 11:07pm UTC](https://forums.unrealengine.com/t/getyawpitchrolldegrees-is-failing-silently/1151193/2 "2023-05-01T23:07:05Z")

</div>

I’m an idiot (with a poor memory)…

```auto
if (DefaultYPR = DefaultRot.GetYawPitchRollDegrees()):

```

Is not failable, so the = is acting as a comparison instead of an assignment.

```auto
set DefaultYPR = T.Rotation.GetYawPitchRollDegrees()

```

I’ll forgive myself this one though, the use of single = for both is ludicrously prone to this type of error.
