Rockhampton is tropical, which means a wet season (November to March) with high humidity, heavy rainfall, and temperatures regularly above 35°C, and a dry season (April to October) with lower humidity and pleasant temperatures. The dry season is clearly the better time to visit: May to August is ideal, with warm days around 25°C and cool nights.
The wet season brings the risk of flooding — the Fitzroy River has flooded the city significantly several times in recent decades, most severely in 2011. If you are visiting between November and March, check weather forecasts and be aware that roads can be cut by floodwater. That said, the tropical storms when they arrive are spectacular, and the lush green landscape immediately after rain has its own appeal.