- Home /
RaycastHit and Wheelcollider
Hello
I know that a RaycastHit function works on primitive or mesh colliders but is it possible to use it on a wheelcollider ?
Thanks
I've never tried, but it should work since Physics.Raycast(transform.position, -Vector3.up, 1.0) only requires a transform position.
Answer by Edy · Aug 13, 2011 at 07:02 PM
No, it doesn't work.
A WheelCollider uses a ray cast on each frame for detecting the contact point. This is the vertical line of the gizmo at the Editor. The circle is just a representation of the WheelCollider's radius and doesn't have any effect on the physics.
As the WheelCollider isn't really a "collider" as the others (it just performs a ray cast on each physical frame) then the RaycastHit function cannot hit it.
Ok thanks for your answer.I had a doubt about the possibility to use a RaycastHit function, so now this is clear.
You're welcome! As this answers your question, you should now mark the answer as accepted :)