x


Prefab Transform variable missing.

Hello there, I have a prefab and it is an object that it has an attached trigger object collider that if an object (PlayerHand) touches the whole object is attached to PlayerHand.

I have to store "PlayerHand" as a variable (transform) in the script and drag and drop the player hand to that variable (everything works fine).

When I create a prefab and put the whole hierarchy on it I noticed that the "PlayerHand" variable isnt in its script. What can I do to store it in the prefab???

Thanks alot!

more ▼

asked Nov 25 '10 at 12:20 AM

Dinart Filho 1 gravatar image

Dinart Filho 1
134 18 19 28

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

1 answer: sort voted first

You can't store hierarchy information on a prefab. A prefab is universal and contains no scene-specific information. What would happen if you tried to drag a prefab containing links from one scene into another scene? That wouldn't work at all. A prefab instance can contain scene-specific info though. You can drag the prefab into the scene and link things up that way.

more ▼

answered Nov 25 '10 at 12:33 AM

Eric5h5 gravatar image

Eric5h5
80.2k 41 132 519

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

x3328
x1279
x1254
x131
x1

asked: Nov 25 '10 at 12:20 AM

Seen: 1435 times

Last Updated: Nov 25 '10 at 12:20 AM