Hi all. I am trying to use “ACTIVE_IN_HIERARCHY_CHANGED” event to check in a node is active in hierarchy, but it call my callback only once, then if I check this one it console, it has activeInHierarchy = false, but callback wasn’t call for this:
nodeClone.on(Node.EventType.ACTIVE_IN_HIERARCHY_CHANGED, () => {
node.active = nodeClone.activeInHierarchy;
console.log(nodeClone.activeInHierarchy);
console.log(nodeClone);
});
now logs:
As you see one node has activeInHierarchy = false, but a callback wasn’t called for this:
in console, only previous console logs with activeInHierarchy = true.
Cocos creator 3.4.0