Yes, I've been caught talking to myself before and had others be disturbed

It is not necessarily a sign of mental illness but could be a sign of a lonely, inward-looking person to be talking to imaginary friends instead of going out and making real ones. I had a group of imaginary friends I talked to, and when I decided that was not appropriate and I wanted to learn to live in the "real" world, I had a heck of a time "killing" them off; that sent me to a therapist for the next 30 years :-)