1

I'm trying to run a function in C# from UnityScript. My UnityScript file has:

GetComponent("C#File").C#FunctionName();

But in the editor it's telling me that the function isn't a member of UnityEngine.Component.

2 Answers 2

1

Try

 GetComponent<"C#File">().C#FunctionName();
Sign up to request clarification or add additional context in comments.

Comments

0

You need to put the "to be accessed" script in one of the folders thats compiled earlier. That does not only mean the editor folder, but also Plugins, Standard Assets and Pro Assets

That way scripts of the other languages are able to work with it.

The only alternative is not to access it directly at all and use SendMessage instead

The least amount of trouble and headache is present if you just focus on one language instead of mixing 2+ languages

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.