Tonic is the first note of the diatonic scale. So if you are Ab Major, like here:
View attachment 7377511
Starting on the tonic means you start on Ab. Somehow I don't think this is what you meant.
Do you mean you have a tendency to play the root of the chord? I.E. you would tend to start the bars with F, Bb, Eb, Ab, Db.
This is a normal tendency for a bass player...as it's usually your job to play and emphasize the roots of chords.
One way to get away from this is to learn and practice the chord inversions
Root Position: F,Ab,C,Eb
1st Inversion: Ab,C,Eb,F
2nd Inversion: C,Eb,F,Ab
3rd Inversion: Eb,F,Ab,C
(You can practice the inversions up and down).
Generally melody tends to use a lot of linear or step-wise motion, rather than arpeggiated chord tones. So using inversions is a step in the right direction, but it will still sound somewhat naive.
Combine the inversions with a focus on the key center will get you closer. This means you will always start on a chord tone, which is not strictly necessary.
A related idea is voice leading (4 part harmony). As I mentioned the bass tends to follow root movement. The inner voices tend to jump to the nearest chord tone, but in classical there is a desire to avoid parallel fifths.
Another way to look at it is to think of target tones.
Something you may be missing is that a certain amount of study and composition usually goes into developing good solos. I think inexperienced players tend to assume that solos are totally impromptu. IMHO, For the vast majority of players this is not accurate. Most of what the typical mortal plays during a solo is stuff they have worked out previously....IMHO very little of it is actually improvised on the spot. The appearance of improvisation it's mostly illusion.