Platformer Raycast Grounding Checker

This component is used to check if a GameObject can be considered on ground based on a given Collider2D component. It uses 3 points configurable through inspector to perform detection using raycasts. Each point position is determined based on the given collider lower bounds.

What it Requires

Through Unity’s inspector you will need to inform what layers of your project should be considered ground.

A Collider2D is required. It might be a BoxCollider2D, a CapsuleCollider2D or even a CircleCollider2D. You can directly specify one (pretty handy in case you are using multiple colliders). If no Collider2D is provided the component will try finding one.

Important

If you are working with multiple colliders be sure to specify one. Otherwise the wrong one might be used instead.

What it Implements

Interface

IPlatformerGroundingProvider

What it Provides

Properties

You can directly access the public properties listed below and benefit from its information.

public bool Grounded;

Events

You can add listeners through code or inspector to be updated every physics update about the GameObject being or not grounded.

public UnityEvent<bool> GroundingUpdate;

Note

If you are not familiar on how to use Unity Events check out the oficial docs .

Seeks For

Nothing.