How can I check if a character is standing on an object and not in an object ?

How can I check if a character is standing on an object and not in an object ? (this is an object with the 2D platform effect) Suggest how this can be done.[163552-screenshot-53.png|163552]

You can add a child object with a smaller collider, and if the character it hits the child collider, then you can know that the character stand in the object.

Due to how physics are calculated, it might be a little difficult to know for certain, but for most cases you can get a pretty good approximation. If you tag the platform effector with something like “PlatformEffector” then you can do the following in the OnCollisionStay2D() method in a script on the object with the player’s Collider2D component:

void OnCollisionStay2D(Collider2D col)
{
	// If the object is actually a platform
	if(col.CompareTag("PlatformEffector")
	{
		// Get the closest point on the collision box to the player's position
		Vector3 closest = col.ClosestPoint(transform.position).y;

		// Get the pivot of the platform
		Vector3 platPivot = col.attachedRigidbody.gameObject.transform.position;

		// If the closest point is above the platform's pivot, and lower than the player's pivot
		if(closest.y >= platPivot.y && closest.y < transform.position.y)
		{
			// The player is likely above the platform!
		}
		else
		{
			// The player is within or below the platform!
		}
	}
	
	// Whatever else you wanna do
}

This is a quick and dirty solution that should work for simple cases. A more experienced user may be able to chime in with better solution.