x


Prefab GameObject's can not be made active!

Hi, I've just received this error, when trying to recursively set an object imported from max to false. I'm not quite sure I understand the error and there's been no mention on it in the forum before. Could anyone explain please? Thanks

more ▼

asked Feb 20 '12 at 05:24 PM

AntLewis gravatar image

AntLewis
315 41 55 66

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

3 answers: sort voted first

I know this is old but I just came across your question whilst looking for the answer to this problem myself... The problem was that you were trying to call SetActiveRecursively() on the prefab itself without instantiating it first.

If you use an object in the Hierarchy you won't run into this problem like you said in your own answer, but in most cases you don't want to instantiate from the Hierarchy like that if the object you're working with isn't constantly in the scene (say, for example, a submenu?).

Bottom line, if you're trying to SetActiveRecursively() something you're getting from a prefab, remember to instantiate it first.

more ▼

answered Apr 18 '12 at 08:42 AM

Datael gravatar image

Datael
555 2 5

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

I think this wa because I was dragging the gameobject from the PROJECT folder and not the hierarchy, in case anyone is interested

link text

more ▼

answered Feb 20 '12 at 05:37 PM

AntLewis gravatar image

AntLewis
315 41 55 66

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

AFAIK even not instantiated prefabs (objects in the projects folder rather than in the scene hierarchy) are still valid GameObjects and can be performed most actions with. Not sure if they can be activated, though you can access its members, components, children etc. without instantiating it first.

more ▼

answered Jan 07 at 05:01 PM

Pangamini gravatar image

Pangamini
16 5 5 8

(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
x1672
x1255
x31
x3

asked: Feb 20 '12 at 05:24 PM

Seen: 1234 times

Last Updated: Jan 07 at 05:01 PM