Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • 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
0
Question by DaveyDaVinci · Aug 09, 2015 at 03:54 AM · colliderscollision detectionraycastinglayers

Best method to make the main character traverse multiple layers of objects using Unity 2D

game scene

I'm a mobile gaming student, I have a question regarding traversing multiple layers and disabling colliders. My game scene has 3 tiers of objects, and the goal is to have the character be able to traverse them by either jumping on them or swiping down to drop. The bottom tier is in the foreground, all the way to the top tier being in the background. I've been trying to find the most effective solution to disable/ignore collisions between the main player and objects not in the current tier.

As I have it set up right now, I have 3 invisible triggers spanning horizontally across the screen, and a small trigger underneath the character. When these triggers interact, the main player's sorting order changes to whichever trigger was last activated. Then I have the player ignore any collisions that are outside of his sorting order. This works fine about 70% of the time, but I'm running into an issue of him falling too quickly for the triggers to activate--also he'll randomly fall through some objects even if he's been running on them for a while.

I'm not looking for code, but instead looking for advice on the proper logic to implement layer traversal, and which Unity systems I should use. I've been stuck researching the best way to implement it--including using a horizontal raycast to switch a bool on the objects, then ignore collisions based on that, but I can't figure out an elegant method to then switch that bool back. Any help would be TREMENDOUSLY appreciated, as I've been stuck on this particular issue for almost a month. THank you so much

David

help.png (390.4 kB)
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 allenallenallen · Aug 09, 2015 at 03:55 AM 0
Share

Quick idea here:

How about only enabling collisions when the character's Y component or height is higher than the other objects?

avatar image DaveyDaVinci · Aug 09, 2015 at 05:06 AM 0
Share

Okay, I'll look into doing it that way. THanks for the suggestion

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by RemDust · May 25, 2016 at 02:13 PM

Why not using the 2D platform effectors ? I think this could be exactly what you're looking for, check it out. :)

Comment
Add comment · Share
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

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.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

3d map of all colliders in scene 1 Answer

Raycast2D doesn't seem to work correctly. 1 Answer

How can I let the ray to the edge of the capsule? 1 Answer

Temporary disable collision, what's best performance-wise 1 Answer

Right Click to Ignore All But Terrain, How? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges