x


Assigning varaibles to prefabs

Ok so i have a 'player' prefab and a 'Tank' on the scene already. Im using the networking tutrorial made by unity ot create a multiplayer part to my game. Only problem is hwne i spawn my 'player' the variables he uses such as the 'Tank' 'TankCamera' and a GuiText attached to the tank are not there. Is there any way to assign them on connection?

Thanks in advanced

more ▼

asked Aug 20 '10 at 05:22 PM

Raul 1 gravatar image

Raul 1
1 1 2 2

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

1 answer: sort voted first

you can assign these variables to your player after spawning. you can do this by something like : [GameObject.Find()][1] or [GameObject.FindWithTag()][2];

more ▼

answered Aug 20 '10 at 07:57 PM

AliAzin gravatar image

AliAzin
2.5k 41 56 79

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

x5076
x822
x804
x709
x92

asked: Aug 20 '10 at 05:22 PM

Seen: 476 times

Last Updated: Aug 20 '10 at 05:22 PM