GoalKeeper Bugs?

my code seems fine but it still says

my code

while True:
    friends = self.findFriends()
    for friend in friends:
        self.command(friend, "move", {"x":15,"y":ball.pos.y})

1 Like

This returns an array of all the balls.

You can’t move to an array’s pos.y so maybe you should use something else instead of ball…


ok (20000000000000000000)

1 Like

As @MidnightWolf39 stated, findByType() returns an array/list of objects, not a single object. In order to get the nearest ball, you should use the findNearest() function to get the nearest object in that array/list. For example, I would do nearestGriffinRider = hero.findNearest(findByType("griffin-rider")). So try applying that to the ball object.


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