Have you checked it items was an array or a single variable?
items[0].pos.x and items[0].pos.y
1 Like
You’re making your charter to multiple places so it gets confused.
use robanybody’s idea or you can make a new variable “item”
item = hero.findNearest(items)
and use that to replace “items” in that line of code.