- Home /
What is the way of checking if gameobjects are the same in build?,What is the right way of checking if an object is the same as another object in build?
For my tutorial, I have a section where the player needs to build an amount of a certain object to continue. The way I'm doing this is by
if(InstantiatedGameobject == TutorialObject)
Running the code in the Editor would return true but running it in the Build would return false. I've tried other ways to check like InstanceID but that also changes from Editor to Build. For now, I'm checking between the names of the objects but I'm not sure if that's for the best.
,In my tutorial I have a section where the player needs to build a certain amount of an object to continue. So I made a check during building to see if the instantiated object is the same as the required object. Like this:
if(InstantiatedObject == TutorialObject)
This would return true when I'm running it in the Editor but when I make a build, it would return false. Why did it change and what would be the best way to do this?
I am not sure if I totally understand your game since its imposible that comparing 2 different objects but "similar" would ever return true. gameobjts dont get "build an amount" could you reformulate the question?