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 /
avatar image
1
Question by NGGS · Nov 12, 2010 at 05:00 PM · physicssweeptest

SphereCasting ignores the mesh collider?

I'm trying to detect if the player is next to the "wall" of my level. My player has a box collider, and the level has a mesh collider set as a trigger. Works fine, no problems, player cannot pass through the wall.

I play an animation every time the player moves, but I don't want to play it if they're going to collide with the wall so I'm trying to test for it. First I tried SweepTest, it returns no collision. I've tried Physics.CapsuleCast and now I'm trying Physics.SphereCast and I'm getting no collision, it's as though it doesn't see the mesh collider. Is it a meshcollider limitation, a problem with the mesh being a trigger? Do I need to do something with layers for this to work?

I even tried:

if (Physics.SphereCast(rigidbody.position, 2.0f, movementDirection, out hit, Mathf.Infinity))

and there was no response, so I don't think this is a distance or radius problem. (movementDirection in this case is Vector3.down)

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 Adam Rademacher · Nov 12, 2010 at 05:07 PM 0
Share

If you make the mesh collider a non-trigger does it return properly? It sounds like it is probably an issue with trigger interactions. I don't think that physics casting can tunnel through colliders, but you could also try putting some invisible box colliders around your level to cast against.

avatar image microp · May 12, 2011 at 08:50 PM 0
Share

I've come to the same conclusion: my SphereCast works fine with SphereColliders but ignores $$anonymous$$eshColliders. Have you come across a workaround in the last six monthts?

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.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

2D 360 degress platformer example needed 0 Answers

Moving and SweepTesting a kinematic Rigidbody multiple times within a single FixedUpdate() call 0 Answers

How does Totally Accurate Battle Simulator's physics and animations work? 0 Answers

Physics gravity appears very weak 2 Answers

Bullet getting repelled when coming closer to it's spawn point. 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