Can’t understand how work method >iterate< for group.
I want get property of the object in Set structs like this:
group.children.iterate((child) => {
console.log(child.y); // It’s work, in console I see position of the gameObject
});
But, this code does not work
group.children.iterate((child) => {
if (child.y > 1000) { console.log(‘Show error’); }
});
It throw error in console: can’t get property ‘y’ of the undefined.
How I it understand - any expression does not work… Why? It something special in work Set structs?