In this project you can also pick up and throw grenades. Your grenade can have any mechanic you want. There are several types of grenades included by default. After you throw a grenade you fire any logic you need.
To create a new grenade, first of all, we need to add a new row to the E_GrenadeTypes enumeration.
Now you need to create a child of BP_Grenade. This class will be spawned in the world after you throw it. In this child, you can add your own logic or use an existing one.
Create a new row in the DT_Grenades data table and set here your created type. With this blueprint you need to initialize the actor variable in DT_Grenades data table. Overview mesh is used to show it in the BP_Interactable_Grenade.
After you have created the row in the grenades data table you need to initialize this grenade in the items data table. Here you have to set the type to “grenade” and set your created row in DT_Grenades in the TableRow variable.
After you created a new row in the items data table, you can create a new child of interactable actors (Picture 68). In this actor you need to initialize the Actor variable with a grenade row from the items data table. You can also set the amount of items - this is a quantity of items you will pick up. After you placed this actor in the world you will be able to interact with it.