Double ray-collision to stick to a surface.
The Ray-Collision-node is very practical to stick objects to irregular surfaces.
The collision will be detected between two “ray points” (null objects) above and under the surface. The node outputs the distance from the bottom point.
Now this simple setup is good enough for most situation but it doesn’t give you the direction of the detected point.
Now duplicate the setup and offset it from the first one and put a target expression on the resulting detection. The result is a null that points to the first detection point and thus is in the direction of the surface.
It is probably easier to follow the above setup than to read my explanation.