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"

SetActorLocation Desync problem

Hey everyone,

So I've dealing with an issue that has been persistent in a multiplayer game I am developing. I developed a function that basically freezes a player at their current location for a second or so. I accomplished this by using SetActorLocation every tick and I had this function set to Run on Server. The issue is that when the Server uses the function in midair, I expected the client to see the Server floating in midair, but instead the Server player falls down to the ground on the Client's side. Does anyone know why this is happening?

Product Version: UE 4.12
Tags:
more ▼

asked Aug 14 '16 at 02:18 AM in C++ Programming

avatar image

RadiantWings
66 13 15 18

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Does the client fall and then rubberband back up to the location or does it simply fall? I would recommend a multicast call that disables/enables gravity, sets the velocity to zero, and sets the actor's location. Don't try and fight the physics system. Work with it.

more ▼

answered Aug 14 '16 at 05:38 AM

avatar image

Shohei
1.1k 30 8 39

avatar image RadiantWings Aug 14 '16 at 01:18 PM

Ah right I should've mentioned, on the Client side, the Server player falls but when I go do something like look around the position is corrected on the client side but then it falls again. I'm going to attempt to fool around with some variable replication and see if that's the case. I'll also try doing a Multicast and see how that works out.

avatar image RadiantWings Aug 14 '16 at 04:27 PM

Alright it seems that Multicast-ing the Gravity change, Velocity change, and SetActorLocation worked! Thanks a lot!

(comments are locked)
10|2000 characters needed characters left
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