Set actor rotation not working properly when multicasting

Hi,

Using unreal engine 4.7.1, I have a set of players spawned on server and replicated on clients, each client controls one of characters, so a typical multiplayer setup.
Now, when one client does a certain mouse movement, character turns around and faces other way. This works great on server, but then seems to work randomly on clients, as it only works about 50% of time and not on a pattern that I can discern.
actual character BP’s code is pretty simple. It always gets called when it needs to be (checked by a simple print) but actor rotation somehow doesn’t always do its thing.

https://forums.unrealengine.com/attachment.php?attachmentid=29808&d=1426269471

Hi ,

I haven’t been able to reproduce this behavior in 4.7.3. Are you able to reproduce this behavior in a new project? If so, could you upload it somewhere and get me a download link? Otherwise, if you could show me your basic character movement Blueprint setup, I can see if I’m setting this up differently than you. Thanks!

Hi ,

We haven’t heard back from you in a while, so I’m resolving this post for tracking purposes. If you’re still experiencing this issue, please feel free to respond with information requested above. Thanks!

Hi, sorry I haven’t been able to get back to you before. I’m using UE 4.7.6 and problem is still there. You can find attached character BP in T3D format. Hope that helps. link text

Hi ,

I’m sorry, but UE4 can’t import T3D files. You can simply grab the .uasset file for Blueprint in project’s Content folder, and /attach that here. What template are you using for this BP?

I’m using 2.5D template.
I’m including most BPs, just in case.
Again, thanks for help.link text

I looked into what you attached, but there’s a lot of missing references and bad casts in here and it’s difficult to parse through what’s left. I’m still not reproducing what you’ve described, but I think that’s because of hack job I had to do piecing things back together. Have you been able to reproduce rotation replication issue in a new project? If so, could you upload that somewhere like Google Drive or Dropbox and send me a link?

Here’s a link to file you requested. I will try to copy all assets into a new project, see if that helps.
Thanks again for your time and help.

https://.com/file/d/0B22WzywJm3dFWENXX3k3dDZzSG8/view?usp=sharing

Thanks for project, ! I can confirm what you’re seeing, though oddly I can’t seem to reproduce problem while I’m watching Character Blueprint. I believe this may be related to a known issue with rotation replication (UE-14179), but I’m conferring with developers to confirm. I’ll let you know what I find out. Thanks for your patience!

Hi, thanks for looking that up. Is there any way I can check for that bug’s status? And also, can you think of a workaround that might work for me?

,

So it looks like this is unrelated to bug I mentioned previously (which doesn’t affect your project at all). Instead, we believe this is a conflict between natural replication of Character that occurs inside CharacterMovement component and manual multicasting you’re doing. You’re using a Multicast Custom Event to change Actor’s rotation, when instead you should use Set Control Rotation without multicasting, because Control Rotation is what drives Character.

I took your project’s MyCharacterBP and replaced Set Aim section with this:

Here we’re doing same basic Multicast to rotate ShootSphere component, because currently rotating anything other than Character’s Capsule via ControlRotation or OrientRotationToMovement on a Client needs to be done explicity with an RPC. But we’re using Control Rotation to flip character on Client, which naturally replicates back up to Server and all other Clients. You’ll also note that I removed double check for LookingLeft and AimingLeft, because with this configuration that double negative can cause conflicts.

I also noticed you’ve enabled all Replication settings in your PlayerController’s Class Defaults. This isn’t necessary, and may not be doing what you think it is. While Character exists on Server and all Clients, Controller only exists on local machine. Setting it to replicate is sending unnecessary information all over, and generally isn’t needed. Doesn’t affect this setup either way, just figured I’d let you know.

Hope this helps! Let me know if you have any questions.

Oops, yep, forgot I had made that change. Glad this works for you!

Great, that works very well. I just had to activate the “Use Controller Rotation Yaw” section on Pawn attributes to make your solution work. Kudos to you!