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"

Server vs Client. Client will not play animation but server does (on action mapping button press)

I'm trying to get a character to play an animation when q is pressed. I have an action mapping event in the character that calls a multicast function in the game mode. The function sets a Boolean to true called PlayQAnem (which is used by the animation blueprint to play the correct animation). The function then activates the particle system on the character's weapon (as each function is character specific I do not need a player controller to know what weapon to activate, as all the character's weapons are different).

Works fine when the server presses q, client and server both see the animation played and the particle effect, however, when the client pressed Q, nothing happens, at all, the character can still move and turn ect. I am fairly certain my functions and variables are all replicated and am running out of ideas.

I'm happy to post screenshots of the blueprint if you want, I just typed it first to see if anyone knew what was going wrong right of the bat. Thank you in advance!

Product Version: UE 4.14
more ▼

asked Feb 10 '17 at 03:11 PM in Blueprint Scripting

avatar image

The Twish
1 1 2 4

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

1 answer: sort voted first

It's simply because clients has no authority on replicated things. The server has the authority. So here is the way to go:

  • Player press Q on the client side

  • Client call a server RPC function to tell him "Hey, I pressed Q, please set the boolean to true"

  • The server set the boolean to true

  • The boolean is replicated over the network (see my second part bellow to know how)

  • The client now has the boolean set to true as well

  • Everyone is syncronized now :)

The "'second part": To go further, there are to way to replicate things from the server to the clients:

  1. Use the replication property of the variable and let UE4 take care of it. You can use a RepNotify to know when the client recieve the freshly updated variable.

  2. Use clients RPC. The server will call theses RPCs to set the variable on clients side. This is more like a manual replication :)

I hope I was clear. I suggest your look at this https://wiki.unrealengine.com/Replication :)

Good luck.

more ▼

answered Feb 10 '17 at 03:20 PM

avatar image

692 32 22 56

(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