# Function "SetActorRotation " when called on the server side is being arbitrarily replicated to clients

**URL:** <https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802>\
**Category:** C++\
**Tags:** rotator, Replication, unreal-engine, transform, question, CPP\
**Created:** [January 30, 2025, 7:21pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802 "2025-01-30T19:21:45Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheSubZer0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSubZer0](https://forums.unrealengine.com/u/TheSubZer0)\
**Post date:** [January 30, 2025, 7:21pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/1 "2025-01-30T19:21:45Z")

</div>

Can anyone help, how do I make the function when called on the server side `SetActorRotation(NewRotation, TeleportFlagToEnum(bTeleportPhysics));` to stop arbitrarily replicating to the clients???

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/4/f/a4f1a267ec587b8e479fc3c5ad5dd015171c0b55.png)

---

<div class="post-metadata">

**Author:** ![King0fChaos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@King0fChaos](https://forums.unrealengine.com/u/King0fChaos)\
**Post date:** [January 30, 2025, 7:57pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/2 "2025-01-30T19:57:12Z")

</div>

Just guessing here:  
Is your actors rotation enabled by default?  
This could replicate your rotation more often then you intend.

You can:  
disable bReplicateMovement  
AActor::AActor()  
{  
bReplicates = true; // Keep replication for other properties if needed  
bReplicateMovement = false; // Prevent UE from auto-syncing rotation  
}  
or manually replicate your rotation.

---

<div class="post-metadata">

**Author:** ![TheSubZer0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSubZer0](https://forums.unrealengine.com/u/TheSubZer0)\
**Post date:** [January 30, 2025, 8:03pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/3 "2025-01-30T20:03:03Z")

</div>

I have already disabled `Breplicate movement` as seen in the photo.  
In my case, I just want the server to in no way replicate its rotation to the clients, I just want each one to have its own transformation.

---

<div class="post-metadata">

**Author:** ![King0fChaos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@King0fChaos](https://forums.unrealengine.com/u/King0fChaos)\
**Post date:** [January 30, 2025, 8:14pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/4 "2025-01-30T20:14:02Z")

</div>

Hm then there must be some mistake.

Normally if you dont replicate the movement, this all here does NOT get replicated.

- **Position (Location)**
- **Rotation**
- **Scale**
- **Velocity**
- **Simulated Physics Transform Updates**

How do you call the funktion or how is your actor set up?  
Aka replication does not happen randomly.^^

---

<div class="post-metadata">

**Author:** ![TheSubZer0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSubZer0](https://forums.unrealengine.com/u/TheSubZer0)\
**Post date:** [January 30, 2025, 8:17pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/5 "2025-01-30T20:17:58Z")

</div>

**It’s inside the tick event, but I use the “bIs Server” condition and if it’s true, it sets the rotation.**

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/b/beb886f0a7987763fee1adfa8cf69829dee96533.png)  
It’s in blueprints, but I immediately saw that this can only be solved in C++  
@King0fChaos

---

<div class="post-metadata">

**Author:** ![King0fChaos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@King0fChaos](https://forums.unrealengine.com/u/King0fChaos)\
**Post date:** [January 30, 2025, 8:27pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/7 "2025-01-30T20:27:10Z")

</div>

Okay well, you call this function when its the sever. So you want to run it on the sever?  
Normally i ahve a setup like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/a/02a675e499b2e41bc98dcac8ea6e4c545e7293f4.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/c/ccc1288a2df2f138adfb0382540661d7b93191d0.png)  
If i want an event only on the client side, i normally only call the event “not replicated”. Then it simply does net get replicated.  
Normally an event needs to be on called serverside and multicast, otherwise it would only update for the sever but not the clients.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/2/1/321a5d90c3542f4e80e59db40c12ed045b850993.png)

---

<div class="post-metadata">

**Author:** ![King0fChaos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@King0fChaos](https://forums.unrealengine.com/u/King0fChaos)\
**Post date:** [January 30, 2025, 8:29pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/8 "2025-01-30T20:29:27Z")

</div>

Aka have you checked and tested it client and severside?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/e/8/5e8a9acaa6d1a1f61a57ad3fed8706d20bba60d1.jpeg)

---

<div class="post-metadata">

**Author:** ![TheSubZer0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSubZer0](https://forums.unrealengine.com/u/TheSubZer0)\
**Post date:** [January 30, 2025, 8:29pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/9 "2025-01-30T20:29:41Z")

</div>

Yes, but in my case it is not an actor of type character, pawn or controller type, just an actor. This started happening after I went to Unreal Engine 5.4.4, until version 4.27 this did not happen.

---

<div class="post-metadata">

**Author:** ![TheSubZer0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSubZer0](https://forums.unrealengine.com/u/TheSubZer0)\
**Post date:** [January 30, 2025, 8:29pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/10 "2025-01-30T20:29:56Z")

</div>

yes too

---

<div class="post-metadata">

**Author:** ![TheSubZer0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSubZer0](https://forums.unrealengine.com/u/TheSubZer0)\
**Post date:** [January 30, 2025, 8:31pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/11 "2025-01-30T20:31:13Z")

</div>

I already reported this as a bug to Epic Games a few years ago, but was ignored.

---

<div class="post-metadata">

**Author:** ![King0fChaos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@King0fChaos](https://forums.unrealengine.com/u/King0fChaos)\
**Post date:** [January 30, 2025, 8:32pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/12 "2025-01-30T20:32:57Z")

</div>

Nope sry then my remote help is at its limit.^^

Basically a pawn, character or controller gets replicated the same way an actor does.

Its the same logic behind it.

Sry remote i am atm out of ideas. And out of time today. If you need more help i could check it out, but that would fall under debugging or tutoring.^^

If i get another idea ill post it.^^

---

<div class="post-metadata">

**Author:** ![TheSubZer0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSubZer0](https://forums.unrealengine.com/u/TheSubZer0)\
**Post date:** [January 30, 2025, 8:33pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/13 "2025-01-30T20:33:31Z")

</div>

Ok, thanks

---

<div class="post-metadata">

**Author:** ![King0fChaos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@King0fChaos](https://forums.unrealengine.com/u/King0fChaos)\
**Post date:** [January 30, 2025, 11:38pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/14 "2025-01-30T23:38:08Z")

</div>

Ah you said it worked in UE4 but not UE5, try to rebuild that function in a UE5 fresh BP.

Might have failed to update right.

---

<div class="post-metadata">

**Author:** ![TheSubZer0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSubZer0](https://forums.unrealengine.com/u/TheSubZer0)\
**Post date:** [January 30, 2025, 11:51pm UTC](https://forums.unrealengine.com/t/function-setactorrotation-when-called-on-the-server-side-is-being-arbitrarily-replicated-to-clients/2310802/15 "2025-01-30T23:51:11Z")

</div>

Now I’ve already created a workaround to fix this, basically I rotated a parent component (of the character) to which this actor (weapon) was attached instead of rotating the actor on the server side.
