How should I set up the nodes so when the player collides with different loot it will go to the actions after it?
All loot should derive from a parent class. Lets say BP_LootItem.
This parent class should contain variables etc that are universal to all loot items.
e.g. Enumerator ItemType (Shield, Weapon, etc)
Create a child class for each Item Type.
Now your Overlap would work like:
On Overlap → Cast to BP_LootItem → Get ItemType (shield, weapon, etc)…
More advanced approach is to implement Gameplay Tags Interface and a Blueprint Interface.
Each Item would get a specific gameplay tag to fully identify the item.
e.g. Item.Weapon.LongSword
Using the GameplayTagAssetInterface
you wouldn’t need to cast to get this “ID”.
Adding the usage of a BP Interface as a conditional for interaction you mitigate the need to cast to identify interacting actors versus others. Depends on your game, tbh.
Interaction hit/overlap result → Other actor → does implement interface → Branch [true] → get gameplay tag → switch on type…
Create custom functions / events for each type to handle specialized pickup and interaction logic.
Thank you… I used another method- sequence to make it work.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.