I am trying to combine the values of two variables that I am getting from two different scripts and combining in a third.
I am using GetComponent but am running into trouble. I thought something like this below might work but though Untiy doesn’t object to the script when I save it, it tells me “Object reference not set to an instance of an object”.
Could anyone tell me where I need to alter this script to get it to work (or if I should scrap it and start over?)
Thanks. Here’s the script:
var getA = GetComponent (“/Aobject.Ascript.A”);
getA *= 100;
var getB = GetComponent (“/Bobject.Bscript.B”);
getB *= 100;
getA += getB;