Hi, I have this piece of code:
var enemyScript = hit.transform.GetComponent(scriptEnemy);
When run, the console says "'numberOfClicks' is not a member of 'UnityEngine.Component'. " When it is declared as follows in scriptEnemy out with any functions:
Anyone know whats happening here?
The error is correct--numberOfClicks is, indeed, not a member of Component at all. It's a member of your script. Your script is a Component, but a Component is not your script; that's known as inheritance. I assume you're not using Unity 3.4, because otherwise "
answered Dec 21 '11 at 10:34 PM