Bug in Double Cheek


#1

In the level Double Cheek, I set a position, but it said it was an error. Can you help me?

Screenshot:


#2

You must define targetPos. Try using coin.pos. That should work.


#3

It looks like that’s what he did.

@Awsomedude1

Try defining coin using a different method, like hero.findNearestItem. Currently, you are using hero.findItems, which finds an array of items but doesn’t define a particular position of each item or which one to move to. With findNearestItem, you are defining a single position of a single item to move to - the nearest coin. Also, the moveXY method would be better to use here. With the “move” method, the hero takes a single step toward the target position and then iterates through the code again to see if there’s something else it should or could be doing. With the moveXY method, the hero just moves to the item’s position without doing anything else until it gets there. And then it looks for the next nearest item.


#4

@MunkeyShynes

Thank you for your help! I took both of your suggestions and I completed the level!


#5

coin is a array & you need to use coin[0];