Vindomire
(Vindomire)
September 21, 2016, 5:58am
1
odd error where i can compile fine but replicating my chests Inventory causes an assertion error.
.cpp replication:
void APickup_ChestMaster::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
DOREPLIFETIME(APickup_ChestMaster, Gold);
//DOREPLIFETIME(APickup_ChestMaster, Inventory);
}
.h declaration in public:
TArray<TSubclassOf<ABaseInventoryItem>> Inventory;
do i need to create an entry or something for the replication to work? if i uncomment it, it crashes on play but compiles fine.
OmniOwl
(OmniOwl)
September 21, 2016, 6:03am
2
When the game crashes, does it give you a position in code where the crash occurs?
Could be that it tries to replicate something that isn’t there or that it replicates forever? It could be a lot of things.
OmniOwl
(OmniOwl)
September 21, 2016, 6:30am
4
So it says it can’t find a certain property called “Inventory” in your Pickup_ChestMaster.
Perhaps you should look that class over and see if anything sticks out?
Do you have UPROPERTY(Replicated) before TArray<TSubclassOf<ABaseInventoryItem>> Inventory; ?
Vindomire
(Vindomire)
September 21, 2016, 2:04pm
6
Thanks Raikoh, a completely dumb thing on my part, i have other replicated variables i did just fine, forgot that part on this one for some reason, thanks a ton.