Page 1 of 1
Setactive not always working
Posted: Fri Aug 05, 2022 4:01 am
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..
Re: Setactive not always working
Posted: Fri Aug 05, 2022 8:02 am
by Tony Li
Does the scene contain multiple GameObjects named "book"? If so, give them unique names, and update SetActive().
Re: Setactive not always working
Posted: Fri Aug 05, 2022 11:04 am
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..
Re: Setactive not always working
Posted: Fri Aug 05, 2022 12:21 pm
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))
Re: Setactive not always working
Posted: Fri Aug 05, 2022 3:03 pm
by hrohibil
Yes look at my screenshot.
It seems like its executing it right?
But it deactivate it in the Hierachy/scene?
Re: Setactive not always working
Posted: Sat Aug 06, 2022 8:21 pm
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?
Re: Setactive not always working
Posted: Sun Aug 07, 2022 3:09 am
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
Re: Setactive not always working
Posted: Sun Aug 07, 2022 8:09 am
by Tony Li
Great! I'm glad you found a solution.