The Swans had failed to find the net in their three previous games, but regained the killer instinct to beat QPR 4-1 on Saturday.
"The gaffer set down a bit of a challenge before the game," Williams told Wales Online.
"We hadn't scored in three games. So we wanted to win, we wanted to play good attacking football and we wanted to finish our chances.
"We hadn't really talked about the lack of goals, but then the gaffer brought it up before the game and I think we responded."
The win moved Swansea up to seventh in the Premier League.