Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Globox91 · Jun 15, 2016 at 04:12 PM · 3draycastingscaling

Raycast stops working for big scaled objects sometimes

Hello guys :)

somehow i got a strange problem. So i have a very small but highly scaled 3D model of a skull with a mesh collider based on the model's mesh. I had to scale it that large for some complex reasons i don't want to bore you with. Now i want to cast a ray on this model. This worked fine as it was scaled with (20, 20, 20) but since i had to scale it to (150, 150, 150) it won't work at points which are just a little farther away (mostly the edges of the cheeks or the area between the teeth and the chin) but works again at really far away locations. If i zoom to the ignored locations it will work again. In every case DrawRay shows me that the ray is hitting the model (seen in the next pictures).

alt text

alt text

First i thought the ray may be too short but neither Mathf.Infinity, float.MaxValue nor some random really high value have helped. Then i read about that the origin might be in the collider of the skull and so ignores the collider. But this also wasn't the case. I read many other articles about raycast problems but no solution solved my problem. Any ideas what could be wrong here?

overview.jpg (62.1 kB)
hit.jpg (98.5 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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Globox91 · Jun 17, 2016 at 04:01 PM

I have no idea if one can say i solved the actual problem but in any case: i have found a workaround for it. So if i scale the model in the import settings of the mesh and not in the editor the raycasting starts working again. No idea how this comes but it works :)

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
avatar image
0

Answer by agentofzurg · Mar 12, 2017 at 07:09 PM

@Globox91 I just wanted to say thanks for posting this info. I've been searching for an answer for my mysterious raycast problem, and I had the same issue as you - the raycast stopped working after I scaled up my mesh collider. It's now working again, thanks to you!

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 Globox91 · Mar 12, 2017 at 09:36 PM 0
Share

Nice to hear that I could help someone with that :)

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

Scale object by perlinnoise randomized. 1 Answer

Detecting the location of a shadow that is being projected onto a plane 1 Answer

Make my 3D Game resolution fit all mobile devices 0 Answers

Raycast only works while moving 2 Answers

nav mesh agent stop ScreenPointToRay after a while 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