Rotate based on surface?

Okay,

So if you take a look at this video Unity3D Building and Object Placement & Rotation. Let your players build the world! - YouTube and start from 11:42
You can see that the object is moving with the mouse and alligns it to the surface of in this case terrain but that could by anything like a wall or anything else

Anyway… If you also observe how the facing of the object isn’t changeing but it still does allign with the surface

So basicly
I want it to allign with a surface but still keep its facing direction if that makes sense?