- Home /
Problem is not reproducible or outdated
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?
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.
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.
Are you using a normalized direction? Can you post the actual raycast call?
O$$anonymous$$, never$$anonymous$$d. I was stupid, the solution was in "another" script. Case closed. BUT! Thanks for help! :)