March 2019
Intermediate to advanced
708 pages
17h 9m
English
Our new component contains an array of actors, storing them by pointer as well as declaring functions that add or remove items to the array. These functions are simple wrappers around the TArray add/remove functionality, but allow us to optionally do things such as checking whether the array is within a specified size limit before going ahead with storing the item.
InventoryActor is a base class that can be used for all of the items that can be taken by a player.
In the PickUp function, we need to disable the actor when it is picked up. To do that, we have to do the following:
We do this with the SetActorTickEnabled, SetActorHiddenInGame, and SetActorEnableCollision ...
Read now
Unlock full access