Netcode for entities one shot events

How do i create one shot events that happen with an entity using netcode for entities?

For example a damage number or combat cue

You could use RPCs to solve this.
https://docs.unity3d.com/Packages/com.unity.netcode@1.4/manual/rpcs.html

You can also look at our HelloNetcode samples that have various samples that builds up towards a first person shooter. Here we implement shooting and health supported by prediction: EntityComponentSystemSamples/NetcodeSamples/Assets/Samples/HelloNetcode at master ¡ Unity-Technologies/EntityComponentSystemSamples ¡ GitHub

We also have other samples in there. For example Asteroids: EntityComponentSystemSamples/NetcodeSamples/Assets/Samples/Asteroids at master ¡ Unity-Technologies/EntityComponentSystemSamples ¡ GitHub

1 Like

But i need Ghost Relevancy because they happen on specific location. Is there any way to integrate relevancy with rpc?

I am not sure what you mean.

But we have an example of shooting and using hit markers. Maybe that can help you figure out what you need. It doesn’t use RPCs nor Relevancy. But you can add relevancy to your “marker” prefabs if you want.

Not today, unfortunately: ‘RPCs’ and ‘Ghosts with Relevancy’ are not aware of each other (yet). For posterity (for others), follow updates here: Am I implementing network events in the correct way?