Hi all,
Seeing a strange issue that I think may be to do with actor replication over a network.
In this scenario, clients will equip items - this involves making a call to the server to spawn the item, a pointer to that item object is then passed to a multicast function so that clients may set variables that are relevant to them based on the actor in question.
Unfortunately, after the actor has been spawned, and a point to it is passed as a parameter to the multicast function, it comes out as NULL on the client side.
Here is a quick code snippet:
//snippet from the server rpc function
AItemActor* itemActor = ((UOlusiaGameInstance*)(character->GetGameInstance()))->ActorManager->SpawnActorFromBlueprint(character->GetWorld(), deserializedItem->ActorBlueprint);
itemActor->SetReplicates(true);
itemActor->UpdateAllReplicatedComponents();
MulticastEquipItem(character, location, itemData, itemActor);
The first line is quite verbose but essentially it just spawns an actor in the world using UWorld->SpawnActor.
The last line then just calls the multicast RPC function from the server - but when I step through, itemActor comes out as a null pointer.
Is this to do with the item not yet being replicated at this point? Is there another way to resolve this issue, perhaps by making the replication instant?