Hi, i’ve been trying to figure this out for a while, and i can’t get the code to work the way i want. Could someone help me?
I have a zombie that of course has a melee attack, and when he attacks me, i want my health to decrease.
I have two scripts, health script and AI script.
It is in the AI script that i want my zombie to attack, and then i want the health script that is attached to the zombies target to decrease (if it makes sence)
sorry i’m not experienced in JS, but you error body indicates that float values come to parameter in GetComponent function, but it must be string or type,
Thanks, that removed the error. However, i’m now getting a null referance exception when the zombie is trying to attack me.
NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.InvokeBinaryOperator (System.String operatorName, System.Object lhs, System.Object rhs)
AI.Update () (at Assets/_Scripts/AI.js:69)