Time for action – bottoming out
When the player clicks on the invisible Square
GameObjects, the X and O pieces are going to fall gently into place. The rigidbodies attached to each piece will include them in the physics engine, and gravity will take over. However, the pieces will fall straight into oblivion unless we build a "floor" beneath the grid to stop them.
Let's create a floor to keep the falling pieces contained
Create a
Plane
.Rename it as
floor
.Scale it up so that it is larger than the Grid GameObject.
Switch to a Right view in the Scene view and position the Floor so that it sits just beneath the
Grid
GameObject.In the Inspector panel, turn off the Mesh Renderer option for
floor
.
As with the Squares, the floor disappears when its Mesh Renderer option is disabled, but its Collider stays active, which is all we care about.