Hi,
Do I need a comma before 'building'?
I'll be rolling around in the mud building a new fence with which to keep my animals from escape.
Yes.Otherwise, it looks grammatically like 'building . . . ' qualifies 'mud', although of course that would be rather nonsensical in terms of meaning.
A comma will also make the two partsof the sentence easier for the reader to find and to understand quickly.
Clive