x


Access JavaScript variables on c# script (Android build fails!)

Hi, I have the need to access with a c# script some variables (in a javascript). On pc building I have no problems, I've made a javascript that "connects" the other two scripts (js and c#) and I've put it in StandardAssets.

When I build for android i get:

Assets/Standard Assets/Scripts/jsCconnector.js(21,40): BCE0019: 'lookAxisEZ' is not a member of 'UnityEngine.Component'.

No errors in PC/MAC building!

What can I do? Is there a "Standard Asset" for android? Are there others methods to do that?

Thank you.

more ▼

asked Dec 17 '10 at 09:32 AM

stefano 1 gravatar image

stefano 1
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Im unsure about how to fix your problem but I prefer to try to have all my scripts in a certain language rather than multiple languages as when it comes to compile time I know I will not have any errors such as this. There is a Javascript to C# Converter around by Leepo http://m2h.nl/files/js_to_c.php , There is also a much more advanced better version being sold on Unity Asset Store. Just my Opinion though, do what you want.

Script Compiling Reference http://unity3d.com/support/documentation/ScriptReference/index.Script_compilation_28Advanced29.html

more ▼

answered Dec 17 '10 at 11:01 AM

doomprodigy gravatar image

doomprodigy
557 22 26 31

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3460
x2478
x1951
x662
x111

asked: Dec 17 '10 at 09:32 AM

Seen: 2057 times

Last Updated: Dec 17 '10 at 09:32 AM