If ball is an object in a frame, ball.pos is the position local to the frame, not the actual position in "world space". There are two frame functions for translating between frame and world coordinates. Suppose the name of the frame is f, frame_pos is a position within that frame, and world_pos is the corresponding position in world coordinates: