Rust styled object placing

you know how in rust when you are holding an object and it has the same object in it’s place with a lowered alpha so you know where you are placing it? EX wooden foundation would show up on screen in a green or red see through model before you place it. How would this be done in blender without the object going through the ground (so the see through model is parented to the head but does not go through the ground.

You could shoot a ray from the object or something similar to the ground and keep positioning the object above the ground.

I say: two objects a) current cursor b) object reprecenting the nearest fitting location to place the object