Pickups not working on mobile devices

Hey guys, so I have set up runtime pickups for a simple basketball game, and everything works fine in the editor, but when we build for mobile, the character never picks up the ball. Any idea what I might be doing wrong?
 
You can either debug the build, or add debug statements to the source code to see what's going wrong. I would start with checking whether the trigger is working / trigger enter is detected, and then check whether the inventory tries to pick up the item at all.
 
Here's what we observed:
ThrowableItem>>Equip() --> Not getting called
Item>>Equip() --> Not getting called
InventoryBase>>EquipItem() --> Not getting called
EquipUnequip>>ItemEquip() --> Not being printed on the device
UltimateCharacterLocomotion>>UpdateAbilities() --> Nothing is being called here
CharacterLocomotion>>Move() --> Since this is being called in FixedUpdate, it is constantly running and difficult to debug.
KinematicObjectManager>>Move() --> Same as above
KinematicObjectManager>>FixedUpdate() -->Same as above
You can either debug the build, or add debug statements to the source code to see what's going wrong. I would start with checking whether the trigger is working / trigger enter is detected, and then check whether the inventory tries to pick up the item at all.
 
So after quite some debugging what we saw is that in the editor when the item is picked up, a slot ID of 0 is passed to the function ItemIdentifierPickedUp in InventoryBase.cs which results in the OnInventoryPickupItem event correctly firing and the EquiUnequip item ability equips the item. However, in a build, the slot ID passed to the function is -1 which results in the above event not being fired, and the equipunequip ability is not triggered. We are unaware as to why this happens only in the build and not in the editor. Is there some platform dependant code we might be missing?
 
There isn't any platform dependent code running. You could attach the build and set a breakpoint within the EquipUnequip ability to trace why a value of -1 is being passed in. I haven't seen this occur before so using the breakpoint method is probably your best route.
 
Hi Justin, we debugged the build with breakpoints, and found that the itemIdentifier of the pickup is returning a null category for some reason. We have added the item type to the pun pickup's itemdefinitionamounts array and set the amount to 1. But the m_Category of the item type remains null. The category of the itemtype in the m_ItemIdentifierMap of the Inventory however, is set to "Items" as expected. So this is why the map is unable to find the itemIdentifier in the map and GetItemInternal returns false and the slot ID remains at -1 for the pickup. Also worht notig - we are not instantiating the pun item pickup at runtime -- it is placed in the scene itself. But this shouldn't matter since it works in the editor, just not in the build
 
Can you reproduce it within a fresh project? Without being able to step through the code I'm not sure what would be the cause.

If the category is null then maybe it's an execution order issue? Although the category is stored within a scriptable object so all of the data should be there.
 
Top