oh god, Castle Eggman 3 on ultimate... I know what you mean. Okay, first things first. Deal with the Jettysyn gunners in your starting area before moving on to Eggman. You don't need more things shooting at you than you already have. Second, use the diagonal spring, and get directly under eggman, and proceed to use a 2-bounce per jump hit combo from underneath him. If you do it right, and don't get shot in the process, you're home free.
BUT, if you see bullets flying at you and you're on the ground, spindash out of the way, and jump back to the area you started from and use that spring again to get eggman high into the air, and start hitting him from below again.
Hope that helps. And if you can't do it as sonic, kill him as tails, using flight.