• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by Koth · Jul 10, 2015 at 07:25 AM · 2dcollisioncollider

Platform Effector 2D ignores IsTouchingLayers

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.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image JuliusMcGhard · Jul 24, 2015 at 09:26 AM 0
Share

I have the same problem, does anyone know a workaround? Adding a trigger collider isn't working for me.

avatar image tarabout · Feb 17, 2016 at 02:45 AM 0
Share

Same problem here, havent found a workaround yet. I mean we could always code our own "platforms" I suppose but I was hoping to avoid that.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Collider2D.IsTouchingLayers() delayed reaction 1 Answer

No Collision in 2d Scene 0 Answers

Physics2D, Box Collider physics inaccuracy? 1 Answer

Unity getting an object to pass through another object but still trigger collision 1 Answer

Unity 2D Collider Safe Sizes 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges