# Set Actor Rotation sometimes not working

**URL:** <https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381>\
**Category:** Community & Industry Discussion\
**Tags:** rotation, mouse-cursor, unreal-engine, question\
**Created:** [July 24, 2015, 12:08pm UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381 "2015-07-24T12:08:32Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9d0f7e71](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9d0f7e71](https://forums.unrealengine.com/u/anonymous_user_b9d0f7e71)\
**Post date:** [July 24, 2015, 12:08pm UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/1 "2015-07-24T12:08:32Z")

</div>

I’m using the Top Down template and I use the following script to rotate towards the cursor (which is called from RMB event):

 ![51339-rotationscript.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/9/1/491d27081b4427a3ca71b598d3c8e9d761f7de82.png)

This function gets called locally on the client. However, the rotation sometimes happens and sometimes it doesn’t. But it always rotates when I’m the server. Why is this? How can I make sure the rotation is ALWAYS happening? There is no other script which is interrupting the rotation.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9d0f7e71](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9d0f7e71](https://forums.unrealengine.com/u/anonymous_user_b9d0f7e71)\
**Post date:** [July 24, 2015, 1:01pm UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/2 "2015-07-24T13:01:39Z")

</div>

Anyone familiar?

---

<div class="post-metadata">

**Author:** ![Fanto88](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fanto88](https://forums.unrealengine.com/u/Fanto88)\
**Post date:** [July 24, 2015, 6:23pm UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/3 "2015-07-24T18:23:42Z")

</div>

I could try suggest 2 things but don’t know if they can be usefull ^^

1. set that the actor to replicated, so when it change on the server it will change on clients too.
2. Make that rotation function run on the server. Create a custom event and set it to run on server

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f3aa8fb9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f3aa8fb9](https://forums.unrealengine.com/u/anonymous_user_f3aa8fb9)\
**Post date:** [August 1, 2016, 6:40am UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/4 "2016-08-01T06:40:51Z")

</div>

I have exactly same problem.

1. Running on a client WITHOUT dedicated server, working well.
2. WITH dedicated server, calling in neither client nor server work. SOMETIMES not working.
3. When you call SetActorRotation in SERVER for character A,  
 → On Client A : My character A sometimes not turn.  
 → On Client B : Character A turns properly.

Return value of SetActorRotation is ALWAYS true. But not turn. WHY???

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6036f100](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6036f100](https://forums.unrealengine.com/u/anonymous_user_6036f100)\
**Post date:** [April 18, 2018, 1:35am UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/5 "2018-04-18T01:35:32Z")

</div>

i have the same issue, it seems only happen on Character with ROLE\_Autonomous

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6036f100](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6036f100](https://forums.unrealengine.com/u/anonymous_user_6036f100)\
**Post date:** [April 18, 2018, 6:45am UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/6 "2018-04-18T06:45:34Z")

</div>

before SetActorLocationAndRotation, call Character-\>GetCharacterMovement()-\>FlushServerMoves() seems solve this issue, not sure this is the right way to fix this.

---

<div class="post-metadata">

**Author:** ![Mesket](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mesket](https://forums.unrealengine.com/u/Mesket)\
**Post date:** [June 20, 2018, 11:45pm UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/7 "2018-06-20T23:45:26Z")

</div>

Same boat here… when I call the rotation it works for every other player but on the local client it works only SOMETIMES. For example, if I call the rotation 10 times, both players can see it well around 5-6 times… the rest, only the other clients sees the rotation but the actual player calling it doesn’t. Same as others, return value from rotation is always true, and every print I made for debuging shows no error, nor in variables, nor in replication (every one recieves the call). I think its a weird bug from the engine itself.

---

<div class="post-metadata">

**Author:** ![Mesket](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mesket](https://forums.unrealengine.com/u/Mesket)\
**Post date:** [June 20, 2018, 11:45pm UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/8 "2018-06-20T23:45:51Z")

</div>

but how you do this from blueprints?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d63df128](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d63df128](https://forums.unrealengine.com/u/anonymous_user_d63df128)\
**Post date:** [September 3, 2019, 7:17am UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/9 "2019-09-03T07:17:26Z")

</div>

YOU ARE AMAZING! THANKS!

---

<div class="post-metadata">

**Author:** ![xdeviloper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xdeviloper](https://forums.unrealengine.com/u/xdeviloper)\
**Post date:** [September 17, 2019, 9:00pm UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/10 "2019-09-17T21:00:58Z")

</div>

AMAZING! THX!  
h:

```
UFUNCTION(BlueprintCallable, Category = "CppBPFLibrary")
	static void FlushMovementData(class UCharacterMovementComponent* MovComp);

```

cpp:

```
void UVR_BPFLibrary::FlushMovementData(class UCharacterMovementComponent* MovComp) {
    MovComp->FlushServerMoves();
}
```

---

<div class="post-metadata">

**Author:** ![Roland\_Price](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Roland\_Price](https://forums.unrealengine.com/u/Roland_Price)\
**Post date:** [July 20, 2020, 12:58pm UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/11 "2020-07-20T12:58:46Z")

</div>

I’ve stumbled upon this topic and I have the exact same issue. Did anyone find a BP solution to this problem?

---

<div class="post-metadata">

**Author:** ![Roland\_Price](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Roland\_Price](https://forums.unrealengine.com/u/Roland_Price)\
**Post date:** [July 20, 2020, 12:59pm UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/12 "2020-07-20T12:59:08Z")

</div>

I’ve stumbled upon this topic and I have the exact same issue. Did anyone find a BP solution to this problem?

---

<div class="post-metadata">

**Author:** ![KaidoomDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kaidoomdev/32/977996_2.png) [@KaidoomDev](https://forums.unrealengine.com/u/KaidoomDev)\
**Post date:** [April 15, 2021, 5:24am UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/13 "2021-04-15T05:24:02Z")

</div>

This is still an issue to this day, I found a hack which is calling the add movement input which forces the character movement component to update the rotation

![335944-addmovement.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/5/5/e55522b57674cae8073a8986192e7abc29395114.jpeg)

---

<div class="post-metadata">

**Author:** ![ShockCheng](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ShockCheng](https://forums.unrealengine.com/u/ShockCheng)\
**Post date:** [October 11, 2023, 3:59pm UTC](https://forums.unrealengine.com/t/set-actor-rotation-sometimes-not-working/326381/14 "2023-10-11T15:59:51Z")

</div>

This hack works!
