A trigger must exist on the ObjectPickup component on the GameObject

EVG

Member
Good afternoon. Is it mandatory to use a trigger on an object pickup? I use item pickup via script using interactable. But every time I get an error, if I do not delete it manually, Error: A trigger must exist on the ObjectPickup component on the GameObject. I use a transition script, and in the Interact method:
C#:
itemPickup.DoItemPickup(character, fpcInventory, 0, true, true);
Sorry for the bad english.
 
What's the error y'get?

Apologies, don;t know if the trigger's mandatory or not, but I'm also working through kinks with using itemPickup =)

Looking @ the ItemPickupBase, I don;t think the trigger's mandatory, looks like it's just checking for ontriggerenter and then whether or not the object in the trigger has an InventoryBase. Figure no trigger just means it don;t try?

Sorry also for bad English, have no excuse... can write it just fine =)
 
Last edited:
Not 100% sure what you're asking - the trigger is needed if you want the player to be able to pick up the item by walking over it. If you don't want that behaviour, then there's no need for it. But since ItemPickup is designed with pickup behaviour in mind, it will give you this error as you have discovered.
 
Every time after updating the character controller, you have to delete this error line again. I would like it not to exist initially, since I pick up items not through the trigger, but in a different way. :)
 
Since that's how ObjectPickup is intended to be used, and it's how it's shown in the demo scene and docs, it's more user-friendly for beginners. You can easily enough subclass ObjectPickup or ItemPickup yourself and override Awake to ignore that error.
 
Top