You can’t find the pos
of null
. You get null
when you define item
. At the very start of the level, there are no coins, so this.findNearestItem()
returns null
. Add an if (item) {
check before you define the variables.
1 Like