Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Loui_Studios · Nov 28, 2016 at 08:02 AM · triggermesh collidersplineconvexconcave

Concave Trigger on Mesh

In my game, I have set up splines that the player can grind along as rails. I have created a script that takes the data from each of the splines and draws a mesh collider based on their shape that acts as a trigger to mount the rail.

This is the best option for me, as it allows the players to create their own rails and saves me and my team time placing the rails without spending ages placing primitive mesh colliders along the spline.

The only problem I have with this system is that Unity doesn't allow me to have concave colliders as triggers, which means that I can only have convex colliders encompassing all of my rails. This is ok for things like this:

alt text

But if I want complex and curvy rail systems ...it comes out like this:

alt text

Obviously, there is no way that I can use this in my game.

Is there any way that I can get a concave mesh to act as a trigger -that doesn't involve me spending money on an asset, or using an older version of Unity?

If not, are there any workarounds?

Thanks in advance.

capture2.jpg (58.0 kB)
capture.jpg (35.4 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by JRonde · Oct 19, 2017 at 09:29 AM

I had a similair problem in a rail design game we're developing. One of the features is that it should detect rail assets clashing a buffer zone of the centreline of the rail track. I created a script that extrudes a profile along the track and creates a single mesh for the buffer. I couldn't use this mesh however because of the same reasons you mention. Unity doesn't support a non convex mesh to act as a trigger. Quite a limitation if you ask me.

I didn't see any other option then just rewrite my mesh creation script to create a mesh foreach section of the track. Perhaps you can do the same. I still prefer the buffer to be a single mesh however. Makes everthing much more simple.

Comment
Add comment · Show 1 · 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
avatar image Loui_Studios · Oct 22, 2017 at 09:47 AM 0
Share

In the end, I used the spline-generated geometry as a collider, and then just checked to see if the player had hit a collider tagged "rail" using OnCollision(). Not a very clean solution by any stretch, but with some simple use of physics layers I was able to make it work with little hassle.

It's a shame that unity doesn't permit you the freedom with complex collision shapes that other engines do. I get that there is an obvious performance hit, but I imagine optimizing this example in particular would have been extremely simple for me if I'd been given the ability to use them as triggers.

Thanks for your answer anyway! Hopefully these workarounds can be of use to other people facing the same problems. :)

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

How to fix Unity 5 Mesh Collider Convex Problems? 1 Answer

Trouble With Imported Model Collider 0 Answers

Mesh Colliders as triggers not working... Work-arounds (raycast)? 4 Answers

Trouble with mesh colliders 1 Answer

Mesh collider convex limit 0 Answers


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