This is part of the script attached to my character
var sceneManager : GameObject;
function OnTriggerEnter2D(other : Collider2D)
{
if(other.tag == "Enemy")
{
print("hit");
//**THIS FOLLOWING LINE IS THE ERROR LINE**
sceneManager.transform.GetComponent("SceneManagerScript").Point();
}
}
the console give me the following error BCE0019: ‘Point’ is not a member of ‘UnityEngine.Component’.
This is attached to the sceneManager
#pragma strict
var counter : int = 0;
function Update ()
{
print(counter);
}
function Point()
{
counter += 1;
}
I know how to work around this problem, that’s not what I’m looking for though. I WANT to know why this doesn’t work when it should. I saw this in a tutorial video and it worked just fine. Thanks in advance.