Question regarding item pickup

yyycct

New member
Hi I set up the pickup ability and equip for my project, and it worked in editor and in build before I upgraded to version 3.0.15. After the update, the pick up and equip in Editor works but it does not work in the build. After a long time of debugging, it seems to be cause by the PrepareItemPickup() function in Pickup.CS, that immediatePickup is false in the editor, but true in the build. I did not change anything for the build, but just does not know why it behave different in Editor vs Build, please help me with this. Thanks!
if (m_PickupItemDefinitions == itemDefinitionAmounts[j].ItemIdentifier.GetItemDefinition()) {
immediatePickup = false;
break;
}
 
Pickup.cs has not been changed since October of 2022 so I doubt that is the cause. I recommend enable script debugging on your target device and step through the code to see what is different. This will allow you to determine the path in the editor versus the build to determine what part is different. From there you can determine why it is different.
 
Pickup.cs has not been changed since October of 2022 so I doubt that is the cause. I recommend enable script debugging on your target device and step through the code to see what is different. This will allow you to determine the path in the editor versus the build to determine what part is different. From there you can determine why it is different.
Hi Thanks for the quick reply, sorry I did not explain clearly last time, the ItemDefinition that is in the item pick up prefab I set up is behavior differently in build vs Editor.
 
Top