Hello everyone. First post here.
I just updated to Unity 5.1.1 from Unity 5.0 and I am creating a 2D platformer.
My main character uses this code to detect whether the player is grounded (to reset jumping):
public Collider2D groundCheckCollider;
void Update()
{
...
grounded = groundCheckCollider.IsTouchingLayers(LayerMask.GetMask("Ground", "Standon", "Pushables"));
...
}
groundCheckCollider is a Trigger BoxCollider2D set directly below the character.
This has been working great up until I updated to Unity 5.1.1.
I have been using one-way platforms using PlatformEffector2D. However, it seems with the recent changes to PlatformEffector2D, IsTouchingLayers keeps returning false for any collider using one-way platform effectors, even if the one-way platform is below the collider being checked.
Is anyone else having this issue? Can anyone think of a workaround? Currently I’ve added a Trigger Collider unaffected by the platform effector that’s identical in size to the platform collider, which works but isn’t ideal, as jumping through the platform without landing is causing the player to become grounded.