So is there a way to cast a ray that intersects with the mesh of an object instead of the collider (ie if the object doesn’t have a collider or it’s a different shape)?
I can think of several reasons why I’d like this but right now I’m trying to get the distance to a deformed mesh point without recalculating the entire collision mesh.
Jeff
I seriously doubt it as the raycast system is designed to interact with colliders. That would also be what keeps it fast.
If you are just getting the distance to your point, why can’t you use Vector3.Distance?
-Jeremy
Well I don’t actually know what the second point is, that’s why I wanted to use a ray. What I’m actually trying to do is move a small boat along a mesh that is being deformed using the Mesh interface… ie I’m simulating the ocean. So I want the boat to rock as waves pass by, but recalculating the collider mesh every frame is impossible (get 1 frame every 10 seconds doing that). I thought I might be able to use a ray to get the distance to a point of the mesh (not collider) and rotate the boat manually.
So if anyone has any suggestions as to how to do this, I’d appreciate it. You can see a sample web player at http://www.splatsosoft.com/site/unity/
Jeff
This last info simplifies the problem a lot. First off, you presumable have a flat plane that you’re deforming yourself. So you have the deformation math set down, and it’s bound to be simple. So go ahead and use the underlying math to figure out the height at a given point on the water plane: this is going to be orders of magnitude faster than the process you originally wanted: deforming the plane by some function, handing it off to the physics engine, and then asking the it how the mesh was deformed.
This is a perfect example of why one should not just pose technical questions on forums, but also start by giving a bit of context 
d.
Well actually I was using a heightmap that “slides” across the plane repeatedly. So all of the math would be local to the plane, but maybe I could put a query function in the script for the deformation that can be called by the move script on the boat. I’ll try this later and see how it goes.
Jeff