x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

What is the proper way to rotate character with replication?

Hello, thank you for taking the time to read the my issue.

I am trying to manually rotate my character to a replicated rotation variable but i see some jitter on the owning client.

I have:

ThirdPersonCharacter(Self) :

  • Use Controller Rotation Yaw: Unchecked

CharacterMovement :

  • Orient Rotation to Movement: Unchecked

  • Use Controller Desired Rotation: Unchecked

I am using "Play in new editor window" with 2 players and "Run Dedicated Server".

Please see example of issue here: Video showing rotation jitter

alt text

As you can see in the video, the replicated rotation works, but is jittery. When using the built in "Use Controller Rotation Yaw" it works silky smooth.

I am trying to rotate like this so I can have more control over it. I would like to add an rInterpTo for example so my character can have rotation lag (smooth rotation lag hopefully).

  1. Is there a different way (different node/method) I should be rotating my character?

  2. Should the rotation logic be done in the PlayerController?

  3. Is this an issue with blueprints, i.e. this is easily done in c++?

Again, thank you for any help/insight into this issue.

Product Version: UE 4.8
Tags:
more ▼

asked Aug 10 '15 at 04:26 PM in Blueprint Scripting

avatar image

kevinraz
6 1 2 3

avatar image caelanim8ter Mar 10 '16 at 02:37 AM

I have also had this major problem. so laggy, Have you found a way around the issue yet? Or is it still happening?

avatar image caelanim8ter Mar 10 '16 at 09:27 PM

I have discovered the anwer on how to fix this if you are interested,

avatar image Rouli Mar 25 '16 at 07:48 AM

Can you please tell us how you fixed it?

avatar image kevinraz Apr 18 '16 at 01:30 AM

Hey caelanim8ter, I would love to know how you solved it.

avatar image Numbat Mar 11 '16 at 09:33 AM

I'm Interested!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

This is happening, because the Client Fights with multiple GetControlRotation values.

Make sure to only pass ONE Value, and let everyone use that one value.

Here is the Solution that uses the Event Tick. The Control Rotation is set via the InputAxis Turn.

The Character is NOT set to use any Control Rotation on default. So everything is done via the Events.

Local Client tells Server the Control Rotation. That one then Multicasts it to the Network Clients. The Local Client sets the Actor Rotation directly too, so he doesn't fell a lag.

If a Listen Server Calls this, we need to make sure that not any other Server Version of a Network Client calls this, so we make sure the Server Version is Locally Controlled. If that's the case, we skip the Server RPC and directly Multicast and also set the Actor Rotation directly, to fight any lag caused by the Multicast.

EventTick Solution

I, myself, wouldn't use the Event Tick for this. I would hook the InputAxis Turn up with the Rotation and I would add the Axis Value to the Current Rotation and then use the resulting **Actor Rotation* the same way as I used it in the Event Tick Version. Difference is, the InputAxis Turn is only called locally anyway. So we need no SwitchHasAuthority node and also no extra Server Logic. We can simply call the ServerRPC and the Multicast for Clients and the ListenServer.

But, well, in the end, it's up to you guys (:

Cheers!

more ▼

answered Apr 18 '16 at 02:03 AM

avatar image

eXi
6.8k 332 184 468

avatar image kevinraz Apr 18 '16 at 02:11 AM

eXi, thank you for taking the time, very much appreciated!

I have tried a very similar setup to what you have in the screenshot, and your description. I was still seeing some stuttering on the local character though.

I'm going to give it another go and see what results I can get.

Thanks!

avatar image kevinraz Apr 18 '16 at 10:40 PM

This does in fact work as described. Thank you very much eXi!

One follow up question: How would you handle adding interp to, to this? My original goal was allow the camera to rotate around the character, then smooth rotate the actor to the controller rotation.

avatar image eXi Apr 18 '16 at 11:10 PM

Just do all of this on the Client and replicate the final rotation back to everyone, like i showed you (:

avatar image Samuelb Mar 01 '17 at 09:26 AM

I tried using this example to improve my lookat rotation function, it caused the server jitter on the client even more. Any idea how you would get 2 players to constantly lookat eachother without jittering?

avatar image IlllIl Apr 30 '17 at 05:19 PM

I'm having the hardest time to apply interpolation to this. It all works fine until I add the "Net PktLag=" command. Not really sure how to make this example function with the interpolation.

avatar image mightyenigma Sep 30 '17 at 02:59 AM

This fixed my problem with pawns whose location is physics-driven but whose rotation is controller-axis-driven

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question