- Home /
Find raycast collision coordinates of an impending entire object?
Rather than just a point, is it possible to find the raycast collision coordinates of an impending entire object? Would the only way to do this be to extrapolate key points and raycast from a limited set of points from the impending object, or does Unity have further support for detecting surface coordinates when two objects intersect?
Hi ina, i am working on somethings like at during surveillance,when i leftclick mouse on a location or an objects,i want it to display the coordinates of the objects or the location on the scene.is it same as your (Rather than just a point)can you help me?
Answer by Jessy · Dec 31, 2010 at 03:34 PM
Raycast is not the only collision casting method anymore. SphereCast and CapsuleCast should be useful to you. Approximate the shape of your mesh with some of these, in the same way you would with normal static colliders, or colliders parented to bones.
http://unity3d.com/support/documentation/ScriptReference/Physics.html
okay, so for a sphere, would hitInfo return an array of points?
For SphereCastAll, yes. Otherwise no. How could it? hitInfo for SphereCast is a RaycastHit, not an array of them. Anyway, the only way a sphere could hit a collider in more than one place, is if the collider were concave, or the sphere hit multiple colliders. None of the non-mesh colliders can be concave, and you should be using them ins$$anonymous$$d of mesh colliders when possible.