Studio Niantic: Error on IOS browser

Hi everyone!
I run the game on android device fine but on IOS browser I get this error:

TypeError: world.getChildren(topRow).forEach is not a function. (In 'world.getChildren(topRow).forEach(function (childBlock) {
blockInTopRow = childBlock;
})', ‘world.getChildren(topRow).forEach’ is undefined)
BlockController.ts:44:36

My code


const topRow = BlockRows[BlockRows.length - 1]
let blockInTopRow
world.getChildren(topRow).forEach((childBlock) => {
blockInTopRow = childBlock

})

It seems world.getChildren(topRow) does not return an array on IOS browser?. How to solve it?

world.getChildren(eid) doesn’t return an array it returns a Generator.

If you convert it to a standard array using Array.from(), you can work with it in a more familiar way:

Array.from(world.getChildren(eid))

Thanks for your support!

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.