Create new function in the player inventory component called Can Consume, add an input variable type S_ItemInventory called Item In and 2 bool type out puts one called Can Use and another Called Effect Health.

b79cd4e5695f8808a41190d9322cd5ac.png

High Res Image

Create a new variable on the player inventory component called Allow Consumables To Kill Player and set the type to bool and tick the eye icon next to the name.

In the Can Consume function you created follow the screenshots below

a4e0f0e701d8d2a8576d0cae76d01513.png

High Res Image

a36edfe888f77418e24ab844cdebabff.jpg

High Res Image

Then make the changes shown in the images below in the Consume Item function.

ed559c1cd94b473d4da52f65afe02806.png

High Res Image

70f0e3f43ff8f93e6e627ee8289e9e55.jpg

High Res Image

Overview of the changes in the function

1dbe4599f9053ec21e8e70b534d939e8.png

High Res Image

Enable or disable the Allow Consumables To Kill if you want the player to be able to consume items that damage them until death.

Advertisements