Announcement

Collapse
No announcement yet.

Client set viability on server owned actor.

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

    Client set viability on server owned actor.

    Hi!

    I have this situation: In a multiplayer game, when a player pick an item, another actor should set its billboard material visible only to the player holding that item.

    Now, what I have done is: An actor spawned by the server, spawns the Pickable Item, then it searches for all actors that can grab this Pickable item, and for each one of them, sends an interface message with a reference for this Pickable item. Like the image Below.
    Click image for larger version

Name:	CardSpawner.jpg
Views:	174
Size:	383.1 KB
ID:	1375945


    Then, the actor who's receiving that message, binds two events for that Pickable Item, one when its picked, and another one when its dropped. Like this.
    Click image for larger version

Name:	BaseModuleControl.jpg
Views:	158
Size:	336.1 KB
ID:	1375946

    When the player pick up the Pickable Item, the Pickable item fire one event, and when the player drop it, it fires another event, like this...
    Click image for larger version

Name:	card.jpg
Views:	151
Size:	307.2 KB
ID:	1375947


    ... That should set the visibility for an component inside the actors that can receive that pickable item. Like this.
    Click image for larger version

Name:	cabinet.jpg
Views:	166
Size:	290.7 KB
ID:	1375948

    My issue is, the component visibility is only set on the server, not on clients, If I set the bind events to multicast, then all clients and server will see the component. What I want, is only the client who picked the Pickable Item, can see this component.

    I guess, everything I have done is working as it should, but I can't figure out the logic to make the component visible to only the player holding the item. Any advice is very well welcome.

    #2
    So, I figure that I might need to use the player controller or pawn to set that component visibility...Any advice ?

    Comment


      #3
      I solved the issue by having each player controller or character blueprint to toggle the actor visibility.

      Comment

      Working...
      X