# Applying rotations to a player

**URL:** <https://forums.unrealengine.com/t/applying-rotations-to-a-player/818575>\
**Category:** Verse\
**Tags:** rotation, unreal-editor-for-fortnite, fortnite-creative, rotate, question, fortnite\
**Created:** [March 24, 2023, 9:25pm UTC](https://forums.unrealengine.com/t/applying-rotations-to-a-player/818575 "2023-03-24T21:25:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SyntaxzError](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SyntaxzError](https://forums.unrealengine.com/u/SyntaxzError)\
**Post date:** [March 24, 2023, 9:25pm UTC](https://forums.unrealengine.com/t/applying-rotations-to-a-player/818575/1 "2023-03-24T21:25:44Z")

</div>

Hello Everyone!

I’ve tried to run a couple tests on Rotation a player by the yaw, however i’ve had no luck yet. The issue currently is that i am applying the yaw to an rotation but its not updating for the user. I’ve also not found any way to just set the rotation because of an `Data member extension fields are not yet implemented.` Error.

Code below is current rotation script.

```auto
using { /Fortnite.com/Game }
using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }

Rotation_Device := class(creative_device):
    OnBegin<override>()<suspends>:void=
        AllPlayers := GetPlayspace().GetPlayers()
        for (Agent : AllPlayers, Player := player[Agent], FortCharacter := Player.GetFortCharacter[]):
            loop:
                FortCharacter.GetTransform().Rotation.RotateBy(FortCharacter.GetTransform().Rotation.ApplyYaw(2.0))
                Print("{FortCharacter.GetTransform().Rotation}")
                Sleep(1.0)

```

---

<div class="post-metadata">

**Author:** ![DiG3](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dig3/32/1225281_2.png) [@DiG3](https://forums.unrealengine.com/u/DiG3)\
**Post date:** [March 24, 2023, 9:54pm UTC](https://forums.unrealengine.com/t/applying-rotations-to-a-player/818575/2 "2023-03-24T21:54:16Z")

</div>

Hi, it isn’t possible to set a player’s rotation right now.  
`FortCharacter.GetTransform().Rotation.RotateBy` returns a new `Rotation`, i.e. it doesn’t apply the rotation to the original Transform retrieved via `GetTransform()`.

---

<div class="post-metadata">

**Author:** ![AngularRat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AngularRat](https://forums.unrealengine.com/u/AngularRat)\
**Post date:** [March 24, 2023, 10:48pm UTC](https://forums.unrealengine.com/t/applying-rotations-to-a-player/818575/3 "2023-03-24T22:48:56Z")

</div>

As said above, it’s not directly editable, but there is a hacky way to do it if you want to get creative. You can spawn a Teleporter device, set the teleporter device to not preserve momentum, set face player in direction of teleporter, and then call the teleporters .Teleport method, passing in the character. I obviously wouldn’t use that for constant movement, but I’m using it to distribute players around a table conditionally and it works pretty well.

---

<div class="post-metadata">

**Author:** ![Dig\_Squid](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dig_squid/32/1145423_2.png) [@Dig\_Squid](https://forums.unrealengine.com/u/Dig_Squid)\
**Post date:** [March 26, 2023, 7:29am UTC](https://forums.unrealengine.com/t/applying-rotations-to-a-player/818575/4 "2023-03-26T07:29:46Z")

</div>

@AngularRat Ah, does that work? I didn’t think it was possible to spawn or move Devices yet!

---

<div class="post-metadata">

**Author:** ![herbbert](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/herbbert/32/639168_2.png) [@herbbert](https://forums.unrealengine.com/u/herbbert)\
**Post date:** [March 27, 2023, 10:46am UTC](https://forums.unrealengine.com/t/applying-rotations-to-a-player/818575/5 "2023-03-27T10:46:50Z")

</div>

You can respawn your player at a position with a rotation. You only have to get the current position before

```auto
using { /Fortnite.com/FortPlayerUtilities }

```

```auto
Player := Button.InteractedWithEvent.Await()
Player.Respawn(Position,Rotation)

```

> **[FortPlayerUtilities module](https://dev.epicgames.com/documentation/en-us/uefn/verse-api/fortnitedotcom/fortplayerutilities)**
>
> Learn technical details about the FortPlayerUtilities module.

---

<div class="post-metadata">

**Author:** ![SyntaxzError](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SyntaxzError](https://forums.unrealengine.com/u/SyntaxzError)\
**Post date:** [March 28, 2023, 4:56pm UTC](https://forums.unrealengine.com/t/applying-rotations-to-a-player/818575/6 "2023-03-28T16:56:27Z")

</div>

tysm this works, kinda weird tho that its called respawn when it doesn’t respawn the player but just teleports him. But it’s perfectly what i was looking for so can’t complain.  
(is there a reason why there is no respawn display)

---

<div class="post-metadata">

**Author:** ![AngularRat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AngularRat](https://forums.unrealengine.com/u/AngularRat)\
**Post date:** [April 5, 2023, 7:55pm UTC](https://forums.unrealengine.com/t/applying-rotations-to-a-player/818575/7 "2023-04-05T19:55:23Z")

</div>

To clarify, when I say Spawn…I mean, place one in the level. Sorry, that was probably confusing. So you have a teleporter in the level already set up for where you want the character to face, and you just trigger it programmatically.

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [May 10, 2023, 8:57pm UTC](https://forums.unrealengine.com/t/applying-rotations-to-a-player/818575/8 "2023-05-10T20:57:59Z")

</div>

For people actually wanting to respawn a dead player at a specified rotation, this didn’t work for me at first, had to sleep two frames for some reason : (one frame works, but not everytime)

```auto
Agent.Respawn(Transform.Translation, Transform.Rotation)
Sleep(0.0)
Sleep(0.0)
Agent.Respawn(Transform.Translation, Transform.Rotation)

```
