#Null Ref
1 messages · Page 1 of 1 (latest)
Here's how I would approach it
instead of having that one long line starting with bbb, split it into multiple lines. Is the error referencing that line?
I did that already, the error is that it cant get the "damage" variable from the bullet_tempscript
well I suggest you do
Debug.Log(yes.gameObject)
bullet_tempscript theScript = yes.gameObject.GetComponent<bullet_tempscript>();
Debug.Log(theScript);
Debug.Log(theScript.damage);```
One of those has to be null
And if you're saying you already know that damage is null, then why are you worried about the null ref exception?
it cant be, since damage is a float
well one of those things is obviously null. You're saying you already did this?
Debug.Log(yes.gameObject.GetComponent<bullet_tempscript>().damage);
this line also has nullref
Yes, that doesn't tell which component of that line is null
its the damage component
bullet_tempscript?