I declared a function in C++ as
UFUNCTION(BlueprintCallable, NetMulticast, Unreliable, Category = "Gameplay")
void AttachMesh(UStaticMesh* mesh, FName socket);
When I call it on the server it never seems to get replicated down to the clients. It’s not essential, so occasionally failing is ok but I don’t expect it to fail 100% of the time, especially not when I’m just running 2 PIE instances. If I make the function Reliable instead it works as expected so I know my logic is right.
Is there something wrong with my declaration that I’m missing? Or doe unreliable multicasts break in PIE or something for some reason?
Turns out you need to call SetIsReplicated(true) on a UActorComponent for it to replicate unreliable events. I would expect reliable ones to fail as well but that’s apparently not the case.
I’m in the same situation, let me understand. I have a an Unreliable NetMulticast function like this
FTransform const SpawnTransform(HitResult.ImpactNormal.Rotation(), Location);
AExplosionEffect* const EffectActor = GetWorld()->SpawnActorDeferred<AExplosionEffect>(ExplosionTemplate, SpawnTransform);
EffectActor->SurfaceHit = HitResult;
Why does it always fail?