Trouble replicating dynamic material

I have an actor that spawns ground indicator targets (decals) that the player is supposed to avoid while they’re attacking the enemy.

These targets are a dynamic material instance that increase in size via a timeline and repnotify to let the player know how soon the damage is coming.

I’ve got it working on the server no problem but when I play with a listen server and client only the server can see the targets increase in size.

I’ve tried several different ways of setting this up and am at my wits end figuring this network stuff out. Any help would be very appreciated.

Hey Héxnite.

It looks like you are indeed replicating the variable to the client.

But are you applying the new variable value to the material client side?

You can do this in the rep-notify.

Here are the 3 repnotifies attached to that mechanic.

Should I put a Switch Has Authority node and run off of remote in each somewhere?

So, interestingly I removed the Switch Has Authority node right after begin play and it works now.

Hey Héxnite,

This works because it is now running the same code on the server and the client.

But it is not really networked. The client is making its own decision on how big the circle needs to be
And when to spawn the explosion. and not the server.

This might be a bit risky. Since it seems to be a blueprint that at some point will do damage. and then you only want the server to deal damage to avoid some de-sync issues

I created a little demo code. I hope this will help you.

First, I would not replicate the Dynamic materials References. But create the ref locally and on the server. You can do this by putting the blueprints note before the “switch Has Authority.”

All the other code is run on the server.

(I see you are properly spawning the particles on the client and server. So you can ignore the comment in the image)

For the Repnotify

TL;DR Don’t trust Unreal to replicate the Dynamic material instance References.

This is pretty good but I would not trust Area Ref and Circum ref to be replicated. In my experiance those referances don’t get replicated reliable. So maybe you can re create those targets localy

First of all, thank you for taking the time to demo that out for me.

It worked for the most part, just had to set the init values before the Switch Has Authority also.