And there is a player in front of him underfoot cube.

Help on c # code please.
And there is a player in front of him underfoot cube. Need something to while passing through the cube, the cube was underfoot player and followed him.

Solve the riddle.