Download

Static Mesh update doesnt replicate (Plants-Survival Logic)

Hi. Im developing a multiplayer survival game.

You can eat plants so I created an EatDrink Function inside Character BP which works fine and just create a multisphere around the bone of the Head, save a variable with the actors on collision. If the Actors name starts by “PlantsInteraction”, then Add Food, spawn sound of eating and spawn a green emitter like if some pieces of plants falls from his mouth and more things. Everything works fine and replicates perfectly.

Now I wanted to add somekind of Grow System, so all those Plants are cloned actors of “PlantsInteraction” actor spread around the map. Starts with a full plant static mesh with green leafs. I want that when EatDrink Func creates the multisphere and touch the Plant, triggers the EatGrow Function inside PlantsInteract BP where the static mesh changes to an empty plant with no leafs, make a delay of 60 seconds and then grow up again changing back to the initial static mesh of the full plant with green leafs.

The computer hosting the server triggers this mesh change and works fine and replicates fine on clients.
But when clients triggers this mesh update, doesnt make the mesh change and obviously doesnt replicate and hosting server cant see it neither.

The logic I used should work as I did to replicate many other things so what I want to ask is If I miss something silly or not to make it work.
Any idea is welcome.
Thank you

Here there are my-second-try-screenshots of Plants Blueprint and Character Blueprint (which also failed) for the Plants Interaction survival logic I was looking for. Ill add a link to the code inside DrinkEat Function inside Character BP which creates the Multisphere and makes the replication needed:

Now, got all this but everything needed more work. I fixed it just adding a new custom event called EatGrowCycle inside Plants BP, moving RegenTime var and IsEaten? (keeping just this as public and replicated) bool from CharBP to PlantsBP and call the new custom event from Character BP. Now it works fine and replicates as It should.

Maybe its a weird messy way to make this work but right now works and someone could see this useful.

Finally I integrated this method instead as suggested in UE Dev Facebook Group: