Embedded Ground Detectors


Embedded ground detectors were included and briefly covered in the previous tutorial Embedded Collision Detectors, but this time around we will dig a little further...

Using a fast loop it is easy to simulate realistic looking gravity and have our objects walk, run, crawl and hop across any flat or sloping surface. But a problem arrises when an object has an animation frame or frames that don't sit at ground level. For example, a peson running or a wallaby jumping.

   

The problem is that when we move an object up or down a pixel depending on the ground beneath it, the lowest point of the object at that time is used to test the collision and any transparent space below the object in the animation will be lost. As shown below.

   

This is far more noticable in the case of the wallaby animation. In this tutorial you will learn how to use an embedded ground detector to maintain empty space below your objects.