you're doing some weird stuff in your function and i can't really follow your thoughts... you know that the my-pointer is maintained during descending function calls? why are you setting my's position to player's?
is this the full code or are there some parts missing?