O'Reilly logo

Mastering Game Development with Unreal Engine 4 - Second Edition by Matt Edmonds

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required