How can I activate collision for the Z-axis only?

I aim to create an animation that uses moving pillars. The idea is that a floor made of these pillars will rise and create walls. I used a similar system in Maya that uses a script to achieve this. The script uses height maps to raise and lower the pillars. I’m new to UE4 so I’m not even sure which avenue to pursue. whether to use maps to move the pillars or use collision with geometry to achieve this result. As reference this is the look I want to achieve: