Activate GameObjects from quest editor

Announcements, support questions, and discussion for Quest Machine.
Post Reply
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Activate GameObjects from quest editor

Post by GorkaGames »

Hi,

The first option in actions to activate Game Objects in the Quest / Node Editor is Activate / Desactivate by GameObject's name, I was wondering if It can be quite resource consuming if you have a open word with thousands of gameobjects. I'm currently using messages and listeners but this option is much faster to implement.

Also, if by error you have 2 gameobjects with the same name, what's going on?

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

Re: Activate GameObjects from quest editor

Post by Tony Li »

Unity doesn't recommend searching for a GameObject by name every single frame, but it's fine as a one-time action. And in Unity 2018, they made it even faster by making transforms cache coherent.

If there are 2 GameObjects with the same name, it will use the first one it finds. It first searches active GameObjects:

Image

If it doesn't find a match among the active GameObjects, it searches all inactive GameObjects -- but the inactive GameObject's root must be active:

Image

It can be anywhere in the hierarchy as long as the root GameObject is active.
Post Reply