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 ForrestTrepte · Oct 09, 2013 at 05:14 PM · physicsraycastrayintermittent

Physics.Raycast intermittently stops working

After our game has been running for a little while, every call to Physics.Raycast returns false for a little while. The problem comes and goes. Raycasts may stop working for a couple seconds, work again for 30 seconds, and then fail again. We're in a panic getting ready for a demo and aren't sure how to track this down.

When the problem happens, all raycasts in the game fail. User interface (NGUI) raycasts. Raycasts from the camera that we use to pick game objects. Even a fixed raycast that we perform every frame into an object that never moves. They all return false. We can pause the game and check that the objects we expect to hit still exist, are enabled, and have an enabled MeshCollider attached.

Any ideas of what we could be doing to cause this or how to narrow the problem down?

Comment
Add comment · Show 1
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 meat5000 ♦ · Oct 09, 2013 at 05:14 PM 0
Share

Does the game animation appear to slow down when this happens?

Have you modified your layers but not your masks?

1 Reply

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

Answer by ForrestTrepte · Oct 17, 2013 at 04:58 PM

We eventually tracked this problem down to animated characters with a CapsuleCollider. The problem didn't reproduce if we replaced the CapsuleCollider with a SphereCollider. We could pause in the editor, disable CapsuleCollider on some objects, unpause, and raycasts would start working again the next frame.

Based on discussions with other teams, it sounds like Unity's CapsuleCollider has bugs with animating/moving/rotating objects.

Although they have different symptoms, here are some related issues about CapsuleColliders:

http://answers.unity3d.com/questions/126005/the-abnormal-mistery.html

http://www.youtube.com/watch?v=wQAl-k8oRZk&t=9m30s

For now, we're prohibiting use of CapsuleCollider in our game and that has fixed the problem 100%.

Comment
Add comment · Show 3 · 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 whydoidoit · Oct 17, 2013 at 05:26 PM 0
Share

Thanks for posting this, very interesting.

avatar image meat5000 ♦ · Oct 17, 2013 at 05:32 PM 0
Share

http://answers.unity3d.com/questions/550691/game-stutter-on-movement.html

Read Shadow$$anonymous$$'s comments, perhaps see if its related.

avatar image Alabatross · Mar 28, 2014 at 03:12 AM 0
Share

I cannot thank you enough for this comment. You have made me so happy, I thought my project was bugged to no end and was going to revert in a few $$anonymous$$utes! Thank you SO much!

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

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

HOW DO I USE RAYCASTHIT 2D???? 1 Answer

Don't allow raycasts to go through colliders? 3 Answers

When i bring my mouse on layer mask my player doesn't move 0 Answers

why are child colliders sometimes ignored? 2 Answers

Upper limits of Raycasting; Physics engine "gives up" 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