[Question] Set Actor Rotation vs Set Control Rotation

Hey guys, so I’ve been working on some top-down shooter controls and all is going well so far. At one moment I tried to rotate my character based on where the mouse is looking.

Set Actor Rotation

To do this I found the hit location of my cursor and found the lookat vector and then used the ‘Set Actor Rotation’ ( also disabled ‘Use Controller Rotation Yaw’) function to set my characters rotation. This worked perfectly, until I tried a multiplayer game. It seemed that the servers character was being handles fine and replicated to all clients, but the client only rotated locally.

Set Control Rotation

So after a lot of tinkering I turned ‘Use Controller Rotation Yaw’ back on and found the ‘Set Control Rotation’, the end result is the same except now, it also works in multiplayer.

##Difference?
So while I solved my issue, I’d still like an explanation if possible. What is the difference between the 2 functions and where does it go wrong with Set Actor Rotation. I’m asking this to really understand how Unreal works. Thanks in advance!

Cheers,
Oz

1 Like

“It seemed that the servers character was being handles fine and replicated to all clients, but the client only rotated locally.”

That is expected behavior

When on the server, using SetActorRotation will propogate to clients

if you want the client to be able to change the rotation of the server and other clients, you have to run the command on the server, passing in the new rotation from the client


#Control Rotation

Control rotation changes the rotation of the player controller, not the character, so if character is using PC rotation this has an effect.

Useful as always Rama. I kind of had the feeling it was something like this but it’s nice to have confirmation. I will read a little more about the specifics of pawn - controller relationship, it seems to be changed a lot since UE3.

Thanks :slight_smile: