|
I set a var Slider: float = 0; in one script, the mainGUI script lets say. I want to set that variable with a slider. I can make this part work. and then in another script ( lets say a collision ) would like that value (set by the slider) to be seen and used by the second script. like, function OnTriggerEnter (other : Collider) { var setBall = GameObject.Find("steelBall"); setBall.rigidbody.drag = (Slider); } can any one help? -kenm
(comments are locked)
|
|
You can get the value of the slider the same way you set the drag of the steelball. Just obtain a reference to the object (e.g. using GameObject.Find), then you can access all of the variables of that object normally. Also, you will need to set the Slider variable as public.
(comments are locked)
|
|
I am trying to do something similar. I would like to share a hashtable with other objects. is this possible and if so could you give some simple java pseudo code? ...did not know that java is implemented in Unity? is it?
Jul 20 '10 at 02:36 PM
dingben
(comments are locked)
|
