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 /
This question was closed Mar 27, 2016 at 05:48 PM by Vel_1828 for the following reason:

Problem is not reproducible or outdated

avatar image
0
Question by Vel_1828 · Mar 27, 2016 at 05:29 PM · raycastcolliderisnormalized

IsNormalized Error?

I'm in a bit of a clog in here. I'm making a colider.raycast against someobject. Yet, when the raycast is cast from very close to the object (or from the inside), I get an error:

IsNormalized (ray.GetDirection ()) UnityEngine.Collider:Raycast(Ray, RaycastHit&, Single)

I get that it can be caused by the raycast being started from the inside of the tested collider, but how can I disable this error? Like using some "if ( ) " simply to turn off this raycast when it's source is inside the target collider?

Comment
Add comment · Show 4
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 TreyH · Mar 27, 2016 at 05:33 PM 1
Share

If you're sure that's the problem, could do something like

 if (!col.bounds.Contains (rayOrigin))
 {
     // Stuff
 }

Since you know the ray's origin I assume.

avatar image Vel_1828 TreyH · Mar 27, 2016 at 05:40 PM 0
Share

Tried it out, but still the error exists. $$anonymous$$aybe the Raycast origin is right on the surface of the bounding box...

Can't truely say, as the problem occurs on fast-moving projectile hitting the target. Dammit.

avatar image TreyH TreyH · Mar 27, 2016 at 05:43 PM 1
Share

Are you using a normalized direction? Can you post the actual raycast call?

avatar image Vel_1828 TreyH · Mar 27, 2016 at 05:47 PM 0
Share

O$$anonymous$$, never$$anonymous$$d. I was stupid, the solution was in "another" script. Case closed. BUT! Thanks for help! :)

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

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

Related Questions

Rays: why is not working? 1 Answer

Physics2D Raycast, check if my raycasthit2D.collider is the same as my gameObject 1 Answer

Using raycast and collider to increase int 1 Answer

get custom class instance of collider hit by raycast? 1 Answer

Physics.Raycast not hitting anything 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