x


Communication between objects and other scripts, variables and properties

hi there out in the UNITY3D universe, is there a way to read varialbes of a script from an other gameObject? I tryed with a static var, but its do not work. how can I solve this problem?

greetings from Berlin ThisIsTom

more ▼

asked Jan 08 '10 at 10:45 AM

Tom de Jank gravatar image

Tom de Jank
273 7 7 12

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

1 answer: sort voted first

Yes there is, in fact there are many many ways. Start reading about it at these two manual pages:

Also see this answer which gives more detail about creating "dragged references":

How can I access other scripts and their functions?

Static variables do have their uses, but they are generally not the best thing to use for general-purpose communication between gameObject scripts. Until you learn more about what static variables are particularly useful for, I would recommend to avoid using them, and instead learn the methods discussed in those manual pages.

more ▼

answered Jan 08 '10 at 10:48 AM

duck gravatar image

duck ♦♦
41k 92 148 415

thanks a lot for this great help

greetings

Jan 08 '10 at 11:31 AM Tom de Jank

remember to click the 'accept' tick icon if the answer solved your problem.

Apr 01 '10 at 11:28 AM duck ♦♦

he forgot to accept the answer. thanks a lot anyway.

Nov 24 '11 at 02:14 PM rhose87
(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:

x5088
x2091
x825
x53

asked: Jan 08 '10 at 10:45 AM

Seen: 8357 times

Last Updated: Nov 24 '11 at 02:14 PM