I have realized that the function ( UNiagaraFunctionLibrary::SpawnSystemAtLocation) returns nullptr in a given context in multiplayer.
Case 1:
When the player is the host it is executed only once and returns a valid pointer.
HasAuthority() = true
GetNetMode() = ENetMode:ENetMode::NM_ListenServer
Case 2:
When the player is the client, the function is executed twice, one returning a valid pointer and another a null pointer.
//Return a null pointer if
HasAuthority() = true
GetNetMode() = ENetMode:ENetMode::NM_ListenServer
//Return a valid pointer if
HasAuthority() = false
GetNetMode() = ENetMode:ENetMode::NM_Client
I’m looking for a condition to not execute the function in the case that it returns the null pointer.
Simply because it’s a waste to run that code (It is not useful).
The system is generated by an actor who is not a pawn (has not controller).
Then I can’t use the function (IsLocallyControlled())…
Is there any condition that helps me filter out useless executions?
Thank you so much!!