#pragma strict GetComponent from Javascript to C# fails

Hey guys, I am having a problem getting a Javascript file to get a C# script that is on the game object. This is using #pragma strict.

I already moved the C# script into the Standard Assets folder and I still get this error:

Assets/Standard Assets/MyScripts/Enemies/SentryAI.js(37,41): BCE0018: The name 'Seeker' does not denote a valid type ('not found'). 

Here is the line of coding causing the problem:

(this.GetComponent("Seeker") as Seeker).StartPath(this.transform.position, waypoints[currentWay].transform.position);

I have tried all kinda of different GetComponent iterations, and I still come up with the exact same error.

Thanks in advance, Jason

I was only able to get it working if I did one of two things:

1) Move the .js outside of standard assets and keep the C# script in the standard assets folder. (this caused more errors with objects wanting to reference the .js so this was no good.

2)I had to create a function in the seeker.cs file to do what I was doing, and use

gameObject.SendMessage("PathWaypoints", waypoints[currentWay].transform.position);

Hope that helps someone.

Mixing JS and c# is not recommended unless you keep your code interdependencies very clean.
C# gets compiled first and so don’t have awareness of JS scripts.

Switching your code to C# is recommended. You also get extra candy like auto complete.,Mixing JS and c# is usually a nightmare. c# gets compiled first and so don’t have awareness of JS scripts.

So ask yourself if you want to make the effort and switch over to CS or keep banging your head.,Is switching to c# an option ?
Mixing JS and c# is usually a nightmare. c# gets compiled first and so don’t have awareness of JS scripts.