Quantcast
Channel: Answers for "Missing GameObject and Null do not test the same, but how do I test for missing?"
Browsing latest articles
Browse All 12 View Live

Answer by Dave-Carlile

Destroy(block.occupancy); block.occupancy = null;

View Article


Answer by DriesVienne

I have no direct answer, but a workaround came to mind. You could have your occupants reference their occupying collider, and notify the collider when it gets destroyed, thus allowing it to be occupied...

View Article


Answer by Noztradamuz

Ok, maybe some code will help us, to help you, as far as i get with this i think the problem is that you're trying to acces a GameObject that's already been deleted (mean Null or Object reference not...

View Article

Answer by electricear

It actually doesn't need code. When I started troubleshooting the problem I set up a null test in the collider objects Update where it first Debug.Log(ged)the Occupancy, then tested for null and simply...

View Article

Answer by IllogicalGames

instead of using colliders, use compare range between the objects. its much more lighter than colliders since its not using physics. if you want to optimize it further, use on FixedUpdate.

View Article


Answer by huulong

As DriesVienne wrote, using an Observer pattern, messaging system or the like if probably your best bet to cleanly set your references to null before objects are actually destroyed. Unity is using a...

View Article
Browsing latest articles
Browse All 12 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>