It seems like a lot of people giving very vague answers... practice with the drummer, listen, know your part... every good drummer I know wants the same thing, a bassist who knows and can count rhythm.
If you can count the rhythm of the drums, while playing and play a groove that fits in either to the same pattern as the kick, or in between the pattern of the kick, count it, and execute it, that's when it begins to sound good. I see too many guys who can do a lot of flashy stuff, but then you ask them to tell you what type of note they just played, and they're lost. Or they can come up with what they call a sweet groove, but can't play it to a metronome.
Know your rhythms. Count your 8ths and 16ths. Don't play fills you can't count. Subdivide your beats.