Hello, I’m woking on a game similar to Temple Run and I’m spawning (instantiating prefabs) all the platforms randomly to create the way for the run. After the player has passed a platform I need to destroy that platform but I don’t know how to do it…
I tryed putting a box collider over the platform and attach to the platform a script with a OnTriggerExit void to destroy the platform when the player exit the trigger… but then I get an error that says:
MissingReferenceException: The object of type ‘GameObject’ has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object.
I searched a lot in the forum and with Google for a solution but I didn’t find anything… any help would be highly appreciated.
Thanks
what you used to destroy the object?
– Penca53How do you destroy the objects?
– Chanisco