This may have been answered, but after lots of digging I can’t quite find the right working solution.
Here’s what I have. Two scripts:
AICharController which is attached to a GameObject “Enemy”.
MathUtils which is attached to a GameObject “SystemObject”.
I’m attempting to call MathUtils to reference some functions within it, but I keep getting the following error "The name ‘MathUtils’ does not exist in the current context.
Within my class I have the following:
private GameObject _oSystemObject;
private Component _cMathUtils;
// Use this for initialization
public void Start () {
_oSystemObject = GameObject.Find("SystemObject");
_cMathUtils = (MathUtils)(_oSystemObject.GetComponent("MathUtils"));
}
and then later
if (_cMathUtils.IsNullVector(_vNextWaypoint)) {
Any suggestions would be appreciated.
Thanks.
Jason[/code]