How to set a specific degree in Yaw

have a question how i set a specify angle in Yaw, i try to use this code but in the moment i need to return to 0.0 degree doesn’t return

Patrol(Enemy : creative_prop)<suspends>:void=
        loop:
            RandAngle := GetRandomInt(0, Angles.Length)
            if(RandAngle = 0):
                Transform := Enemy.GetTransform()
                Position := Transform.Translation
                Rotation := Transform.Rotation

                NewRotation := MakeRotationFromYawPitchRollDegrees(0.0, 0.0, 0.0)
                NewPoint := vector3{X:= Position.X, Y:= GetRandomFloat(Position.Y, Position.Y + distance), Z:= Position.Z}

                trans := transform{Translation:= NewPoint, Scale:= vector3{X:= 1.0, Y:= 1.0, Z:= 1.0}, Rotation:= NewRotation}
                Enemy.MoveTo(trans, 1.5)
            
            if(RandAngle = 1):
                Transform := Enemy.GetTransform()
                Position := Transform.Translation
                Rotation := Transform.Rotation

                NewRotation := MakeRotationFromYawPitchRollDegrees(90.0, 0.0, 0.0)
                NewPoint := vector3{X:= GetRandomFloat(Position.X, Position.X - distance), Y:= Position.Y, Z:= Position.Z}

                trans:= transform{Translation:= NewPoint, Scale:= vector3{X:= 1.0, Y:= 1.0, Z:= 1.0}, Rotation:= NewRotation}
                Enemy.MoveTo(trans, 1.5)
            

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.