I can't get my code to find out exactly where I click and place a ball

You might find this useful

Screen coordinates by themselves cannot give you a Z coordinate.