Setactive not always working

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Setactive not always working

Post by hrohibil »

Hello Tony

Please see below screenshot.

I have an object (book) which in my dialogue node I get to a point where I set it to be not active anymore "SetActive(book, false);"

But does not dissapear. It still there..
Any thoughts?

I use this method on some other object which works fine..

User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Setactive not always working

Post by Tony Li »

Does the scene contain multiple GameObjects named "book"? If so, give them unique names, and update SetActive().
hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Re: Setactive not always working

Post by hrohibil »

No just one. I even re-named it to ensure i only have that one instance.. Updated and still the same..

-The book set to false in beginning WORKS
-To enable the book when its ready WORKS
-When i take the book it should be false NOT WORKING..
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Setactive not always working

Post by Tony Li »

If you set the Dialogue Manager's Debug Level to Info, does the Console indicate that it's running the command? Something like:

Dialogue Manager: Sequencer: SetActive(book(GameObject))
hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Re: Setactive not always working

Post by hrohibil »

Yes look at my screenshot.

It seems like its executing it right?
But it deactivate it in the Hierachy/scene?


User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Setactive not always working

Post by Tony Li »

It certainly looks like it should be working. If you're sure there's no other GameObject with the same name, can you send me a reproduction project?
hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Re: Setactive not always working

Post by hrohibil »

I am positive there are no more as i also tried rename in order to get unique name.
Apparently there are many ways, I found in your documentation the scene events from a node.
And this works

User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Setactive not always working

Post by Tony Li »

Great! I'm glad you found a solution.
Post Reply