x


Instantiate the subchild (the renderer) from prefab?

What I want is just like the title says

For ones who don't understand: I have the prefab with many children and subchildren in these children. This prefab have the renderer in subchild, I want to instantiate that subchild whenever I press "A", which is the best way?

Here is my trouble right now

1- The prefab just shows the first level children, not show the subchild, so I can't drag the subchild to the script and instantiate it :(

2- If I use the "find" command to find the child. It's will make game slower, whenever I press "A" won't It?

Anyone has another idea?

I'm getting crazy about this for 2 days thinking, searching, etc

Thanks a a lot and appreciate!

more ▼

asked Aug 16 '12 at 06:28 PM

superstar123 gravatar image

superstar123
28 7 8 11

Sorry for my bad english

Aug 16 '12 at 06:29 PM superstar123
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

That sounds like bad design to me what you are trying to do. Each object you want to instantiate should be in it it's own prefab. I'd suggest breaking up your object hierarchy so it can accommodate this.

more ▼

answered Aug 16 '12 at 07:15 PM

Meltdown gravatar image

Meltdown
5.6k 18 25 49

Thanks for your answer

Aug 16 '12 at 07:19 PM superstar123
(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:

x1683
x1260
x414

asked: Aug 16 '12 at 06:28 PM

Seen: 282 times

Last Updated: Aug 16 '12 at 07:19 PM