Creating a new actor class

As noted already, different games have different design needs in this area. If your game only ever had, for example, slots for weapon items (as many popular 3D action games do), then we wouldn't really need an inventory class, nor a weapon pickup class. You could save yourself some trouble by just adding a couple of AMasteringWeapon pointers to your player class and in that weapon, override the AAcotr's Tick(float DeltaSeconds) function to give it a behavior when on the ground, and stop that behavior while it is stored and hidden or shown when equipped by the player. In this case, we have a very flexible and open-ended system that can be used for a large variety of weapons all being stored at the same time. The ...

Get Mastering Game Development with Unreal Engine 4 - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.