Making it collectable

Now we have a collectables base class, and we have a type of pickup item, which is the golden coin. But if we created an instance of it as a blueprint based on the CoinPickup class, it will not be collected, because there is no code to make the character (the Gladiator class) able to recognize the collectables.

So, inside the Gladiator class, I will be adding one function, OnCollectPickup(), and it will work as follows:

  1. The most important thing is that we'll be using the GetOverlappingActors() method of the gladiator collider in order to pick up anything that collides with the character right away. However, in order to store the data found, we will need something like a container for it.
  2. So, the first thing to be done is creating ...

Get Mastering Unreal Engine 4.X now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.