Gathering building materials pays off when you need some quick cover while moving about the map. Usually, building on the fly is needed when someone is shooting at you, but you can also use building to your advantage when you’re the aggressor. There are two types of useful covers that you can throw up in a pinch.
First, you can build a simple wall for cover. You will want to use wood since it builds the quickest. From there, you can peek around the corners to try and see where the fire is coming from. You can also add a window to the wall with the edit function (“O” on PS4, “B” on Xbox One, “G” on PC). The wall will be broken into nine blue-lit panels. Press the firing trigger (or key) on any one of the panels (the center panel works best for cover), then press the edit button again to confirm your selection. Alternatively, you can build a door by also highlighting the bottom-center panel.
In this situation, the person firing at you may also give up their position by shooting at the wall itself to try and break it. Since bullets leave tracers in the air, you can identify the origin of the gunfire if you don’t already know it.
If you want a more versatile — albeit risky — cover, build a set of stairs. Defensively, you should really only do this if you know where the fire is coming from, i.e. you can see the player and they are relatively close to you and on the same level. While crouched, you can inch up the ramp, using the stairs for cover. The slightly higher vantage point will give you a bit of an edge. Stairs can be useful for attacking in the open, too. You can set down two or three sets of stairs to catch an unwitting player off guard by spraying bullets from above.