Announcement

Collapse
No announcement yet.

Having trouble replicating actor variables between clients.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Having trouble replicating actor variables between clients.

    Hi,

    I'm not sure my title is the correct way to describe my problem.

    I can't set an actor variable to replicate correctly between clients.

    Client 1 picks up a weapon off the ground which attaches to his hand and is destroyed from the floor on everyone so no problem there, but I have a line trace that prints the name of the item that is being looked at onto the HUD, for client 1 I can set a variable (IgnoreActor) and add it to an array of actors (IgnoreArray) for the line trace to ignore so Client 1 is not seeing the equipped weapon on his line trace but if I go up to Client 1 with Client 2, Client 1's weapon prints a name on Client 2's HUD and Client 2 can take the weapon from Client 1.

    How do I get the weapon after pickup to add to all the clients IgnoreArrays so that the line trace doesn't see it?

    I've tried setting a variable with the object that I spawned in a multicast event along with several other things but with no success.
    I'm doing this on my Pawn Class, Is that the problem, should I be doing it on my gamestate or somewhere else?

    I can post some picture if that is needed.
    Thanks to anyone that helps.

    #2
    Can you post your blueprint?
    ill look through it and see if I can ffigure nd anything you are doing wrong.

    Comment


      #3
      Your problem is that the ignoreActor array should be set on the server, not on the client. Client variables never replicate to the server nor to other clients, period. When the player wants to pick up a weapon, send a replicated event to the server and do that there.

      Comment

      Working...
      X