#Null Checking
1 messages · Page 1 of 1 (latest)
specifically the null check isn't working, this is how im doing it if it helps
Does it never engage?
yes
yeah, pretty much the only thing that isn't working in the snippet is the null check
when destroyed the gameobject shows as missing in a list, if it helps
brb I've got a yap happy family member
if theObject == null is not true, then the object has not been destroyed
back
Assuming it's a UnityEngine Object
and yet unity still screams at me
Okay so if I'm understanding this, if player selects something it drwas a line to that gameobject?
Right?
im using Destroy(gameObject); to destroy the object
yup
note that it takes a frame to take effect
It's also possible that you're making some assumption about which object is destroyed that is faulty
good point - have you done breakpoints to see what it's looking at, and what it's destroy?
Also wouldn't this result in a selection no longer being true anymore the moment it's destroyed?
well it certainly wouldnt be drawing a line when the object gets destroyed
and it is not drawing a line to the object when it gets destroyed
okay so the moment the object is destroyed, select == false at that point right?
right well, looks like i've fixed it
i was silly, and put the if check too late