Script working in Edit, not working in Build and Run,Script Working in Editor, not working in Build and Run
I have two issues with my script, hoping to get some direction where i'm going wrong.
Issue 1)
OnTriggerEnter2D() I execute an if statement checking if my collider.name is equal to an item name and if it does do something. This works for both the Build, and the Editor. If i do an if statement checking the same thing but with collider.gameobject.tag because i want to group items under a tag, in that case it works only in editor but not in Build. Im running a PC standalone build and run each time.
Issue2)
I have an inventory right now that is basically just an array of image gameobjects that have a child image gameobject attached to it that i change when i want to put an item into the inventory upon collision. This works fine in the editor, i just have a for loop that looks through the array that finds the first item within my array that is empty and changes the image there. Now when i do it in run and build this is no longer working.
Here i have attached the image containing the OnTriggerEnter2D method for reference:
And here is the way i create my array of images if a reference is required:
Id just like to say, im just interested in why such occurrences are happening between build and editor. The way i create the inventory is most likely subject to change.
Thank you in advance!
Pls send help!
Your answer
Follow this Question
Related Questions
Character Controller script cannot jump on top of platform because of slope limit being 45 1 Answer
,Call api and wait answer to return (async?) 1 Answer
Vuforia, C# rotating an object to point another object fixing Y Axis 0 Answers
I tried fixing "Using GUiTexture has been removed, use UI.Image instead" But it wont work 1 Answer
I want to exactly put my player where i want it be. 0 Answers