x


Using a variable from one javascript in another javascript?

I have one Javascript named java1.js

public var dog : int = 0;

java1.js is attached to the game object main camera.

Then the value of dog is changed by a controller input somewhere between 0-100.

Now I have a second Javascript named java2.js

How do I access the changing value of dog from java1.js in java2.js

So I can make a new variable cat = dog

?

more ▼

asked May 26 '10 at 09:47 PM

David 4 gravatar image

David 4
1 1 1 1

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

1 answer: sort voted first

See the docs about accessing other game objects.

more ▼

answered May 26 '10 at 09:49 PM

Eric5h5 gravatar image

Eric5h5
81.5k 42 133 529

(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:

x3570
x850
x59
x21

asked: May 26 '10 at 09:47 PM

Seen: 1752 times

Last Updated: May 26 '10 at 09:47 PM