Condition preventing replication

Hello, I’m blocking on some events that once made on the server won’t happen on the clients because something has changed and it’s not possible anymore. I have 2 different exemples :

The first one is an item that I destroy after being used, so the destroy actor prevent from being destroyed on the client.

I’ve tried to destroy the item on another BP but it dosn’t matter since the calling of destroying it still comes from this actor that is destroyed.

The second example is the condition to do the event is changing in the event itself, preventing doing it on the client.

Here the bucket gets filled on the server so when the client is replicating the bucket is now indeed filled and the rest of the event is not firing.

I suppose I’m not doing the correct workflow for those type of events but I don’t find other ways of doing it

Replicated Actors can only be destroyed by the Owning Class and Proxy.

If the Game Mode spawns an actor, it needs to destroy the actor.
If the Players Server proxy spawns an actor, the server proxy needs to destroy the actor.
If the actor is created locally, it can be destroyed locally.
If the actor is placed in the level, then typically you have a server proxy (player, controller, gm) destroy it.

Also, you don’t ever Multicast a Destroy. Once on the server is all that’s needed.

1 Like

Thanks for the help ! I did the correct way of destroying the actor but it keeps not replicating the actual action (speed increase of the item) because the item is still destroyed before.

The only way around I found is to delay the server action to let the time to replicate, is this the only way to achieve this or is ther any kind of way to listen an event being completely replicated ?
To then fire an event at this time (to avoid the delay in my case). Because I do think that if the action is not replicated in this delay because of latency, it will not work at all.

The entire flow needs to happen on the server.

Character Server Proxy : Set max speed → Destroy actor → unset variable

I’m sorry, I’m not sure to understand how to do this.

I have multiples possible items that each does different behaviours. And as far as i searched, event dispatchers are not replicated at least the binding to it so how can I have my logic happen on the character server proxy ? And what did you mean by unset variable ?

Character BP :

Item parent BP :

And then each item have it’s own logic on the multicast use

I need to know more about the game mechanic you’re trying to implement, or we’ll be here for days. Describe what you want your character to do when the input is pressed. Details matter.


Some insights for you to consider.

Replication only works from Server → Clients. Changes made locally will not be replicated to the server.

Character Movement Component (CMC) has variables that replicate. CMC is also built on client-side prediction (CSP). So for movement related changes (e.g. max walk speed ) you need to apply it directly on the client first, then RPC the server to do so.

With all custom actions (sprint, punch etc) you need conditional logic to determine if the client can do it. Then when the server gets the RPC, it too must determine if it can be done before attempting.

I want to do a consumables mechanic. When my character press the use button, if he have an item,it will use it.
The consumables could be various items from

  • Speed boots (the one i showed)
  • Baseball bat (to swing harder)
  • Armor (add hp)

and many more that I don’t know for now.

The only thing in common they have is that these items will be destroyed after being used.

Held Actor is replicated. Whose spawning it, server or client?
How are you currently determining the Type of actor (boots, bat, armor)?

I’m determining the item type on inventory closed (The player close a radial menu on an item)

Player controller BP :

Player BP : how to show and hide the inventory

It then in the character BP, spawns the item on the server, set held item and multicast the “holding” of the item

Simple as just checking if the player is locally controlled :woozy_face:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.