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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Replication not changing location or rotation from client

Hello,

I have a problem with replication. I'm trying to rotate or move object from client side. Move and rotation are executed in events marked as 'On Server'. The problem is that when I'm using this on server, everything works great. I'm able to see changes both on client and server.

But when I use it by client, Looks like the event are not executing at all.

alt text

Product Version: UE 4.15
Tags:
replmove.jpg (506.3 kB)
more ▼

asked Mar 22 '17 at 09:45 PM in Using UE4

avatar image

JaroMast
355 31 21 40

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

1 answer: sort voted first

Hi there,

a limitation with Client to Server Events (or also Functions/RPCs) is that only Player controlled Blueprints can send those Events.

So try sending this event from you player Character or PlayerController Blueprint, i.e. not from your Door's Blueprint directly.

E.g. using the Character: 1. Get the Character from your Door Blueprint, then... 2. Call a helper function or the Server Event directly on that Character with your Door as a variable. Note: Now you need that Door variable because the receiving Server Character now also needs the Door to interact with.

Tip for later: If you learn using Blueprint Interfaces you could create a more re-usable Server Event on your Character. An Interface (that you don't call Door but e.g. "Interactable_Interface_BP") and Implement in your Door could be used to send the Server a very general Events or Variables like "Toggle Object" or "Set State X" and any Door, Light, even NPC could use this kind of pattern if they also implement the exact same Interface.

-Boris

PS: I can't remember the perfect documentation page, but here we see that On Server events use the player's character:

Run On Server example: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/Networking/ReplicateFunction/Blueprints/index.html#runonserver

Explanation of the Net Owner: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/Networking/ReplicateFunction/index.html


Update: Rough example on how a Character Blueprint could send a Server event using an Interface (more elegant than hard-coding this only for doors).

Notes: See how I underlined the sending Event saying "if owning client" (here the Player Client owns this Character). I also underlined the fact that this is not about Doors (or Actors), this already uses my Interface to set states (here just an Integer, but could be enums, etc. :))

Example on a Character BP to Send Events To Server

more ▼

answered Apr 03 '17 at 03:48 PM

avatar image

Boris.Bauer
36 4

(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