- Home /
can I set a variable for a component to null
I have a variable that is set to null and/or assigned to a Component during runtime. Is there a way to tell the difference? I'm getting some crashes on iOS that I'm finding it hard to debug.
I have a script called "jump.js"
var jumpscript:jump;
During the game the script is assigned to the variable or the variable is set to null.
jumpscript=gameObject.GetComponent(jump);//set it
jumpscript=null;//set it to null;
Will either of these tell the difference between these two without crashing?
if(!jumpscript)
or
if(jumpscript==null)
Comment