Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
  • Help Room /
This question was closed Apr 05, 2015 at 06:22 PM by AlwaysSunny for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Deanit · Apr 04, 2015 at 10:33 PM · unity 5physicsraycastconcave

unity 5 physics.raycast ignores mesh collider

Hi!

I have a custom mesh with attached mesh collider. It is concave by it's nature (planet) and cannot be made convex. Also it is quite tricky to make it from multiple box colliders because of complexity.

I discovered that my raycasts with Physics.Raycast don't hit this mesh/collider while other rigidbodies interact with it as usual.

Please advice what can I do to make Raycast working with mesh presicion on this collider.

Thank you in advance.

Comment
Add comment · Show 3
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 Deanit · Apr 04, 2015 at 10:51 PM 0
Share

AlwaysSunny, thank you very much for clarification. The issue was in my mesh. I just did not think that it can be broken. After changing mesh to similar test mesh - collider worked like a charm.

Update: it seems that collider did not work because initial mesh size was too small. I had to scale it in 3d editor and apply that scale forever (reset xform) to make it working.

avatar image lordlycastle · Apr 04, 2015 at 11:29 PM 0
Share

If you got it solved close the question.

avatar image Deanit · Apr 05, 2015 at 07:43 AM 0
Share

lordlycastle, sorry but i don't see an option to close the question. $$anonymous$$oderator, could you please close the question with AlwaysSunny's comment as correct answer?

1 Reply

  • Sort: 
avatar image
2
Best Answer

Answer by AlwaysSunny · Apr 04, 2015 at 10:33 PM

Possibly the normals of the collider are inverted? Not really sure what else might cause this, though I'd think collision wouldn't work right in that case either. You sure your raycast includes the correct layer? I guess it's possible that the mesh violates some rule(s) about mesh colliders; check the documentation.

A single mesh representing a roughly spherical planet is convex, not concave. If you have things like caves or geological formations with "holes through mountains" or something, I'm not sure what to call it...

In most situations, you'll want to simplify your mesh colliders as much as possible. Stability and performance can often be improved by splitting complex mesh colliders into convex chunks.

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

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to make a Physics.Raycast detect a FPSController? 0 Answers

Getting the error "ullReferenceException: Object reference not set to an instance of an object PlayerCasting.Update () (at Assets/Scripts/PlayerCasting.js:7) on my JavaScript raycasting script 1 Answer

How to make a "raycast" vertically in front of the player ? 0 Answers

Getting 'bouyancy' on water to work. Help! 0 Answers

Raycasthit changes behavior after certain time 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