I am trying to reference a class that is outside my unity script using GetComponent.
private FlyThroughCamera camera;
void Start ()
{
camera = GetComponent(typeof(FlyThroughCamera)) as FlyThroughCamera;
camera.DoSomething();
}
Although the class exists the cast is failing and returning null.
The other class is defined as:
public class FlyThroughCamera : MonoBehaviour
Where have I gone wrong?
EDIT: