This is because the origin of the cube is in the middle of the mesh. Therefore placing the cube at the plane will show the cube halfway under the plane. There are several ways to handle this situation.
One option is:
Parent the cube to an empty that the cube is on top of the empty.
Move the empty rather than the cube
mouseOverSensor.hitPosition helps you to find a position on the plane.
After getting the position on the plane (see above), you can “correct” the position to fit your grid.
An often used method is to round to the next grid coordinate. e.g.
I got the first one. I was able to move the cube at the top of the plane. I was very happy about it.
However. I’m still new to Python Programming and can’t understand the instructions. Can you please instruct it like what you did on the question? Thank you!!!