which is the projectile's Role?

I want to spawn a particle system attached to a projectile.

When “play as listen server” this seem to work:


void UNiagaraAttachedComponent::BeginPlay()
{
	Super::BeginPlay();

	const AActor *TheOwner = GetOwner();
	if (!IsValid(TheOwner))
	{
		message::Error("TheOwner is NULL");
		return;		
	}	

	if (     TheOwner->HasAuthority() || 
             FRoleMode::IsAutonomousProxy(TheOwner) || 
             FRoleMode::IsSimulatedProxy(TheOwner))
	{
		SpawnSystem();	
	}	
}

When “play as client” it seems to works too… but i get a NULL instance of the particle system too. And i want to filter it.

The projectile is spawning on the server and replicated on clients.

What is the right way to do this?

Thank you so much!!

This seem to work better:

	if (
                FRoleMode::IsListenServer(TheOwner) || 
                FRoleMode::IsClient(TheOwner)  || 
                FRoleMode::IsStandalone(TheOwner))
	{
		SpawnSystem();	
	}

I have not NULL instances with this.
If some one know a better solution please let me know.

Thank you so much!!