Hello,
I have an issue with sea mesh. Instead of colliders, I tried to use raycast for determining buoyancy, because i would like to use it with simple waves. But as I still need to use colliders on the sea mesh for the raycast to hit anything I came across the problem that raycast won’t hit collided that uses “mesh instance” … Is there some solution to this?
You do need to use a mesh collider to hit a mesh with a ray. But that doesn’t mean you can’t use it with mesh instances. Just get a reference to the MeshCollider, and assign its .mesh to be the same .mesh as used by your MeshFilter.
I know that i need to use a collider for a raycast… For example, if box with box collider falls onto the waves with the collider mesh instance, it “floats” on the surface, but any raycast fails to detect this mesh instance
Then you’re doing something wrong. Did you try reassigning the mesh to the collider, as I suggested above?
Okay… i was doing something wrong… I didnt realize that colliders wont hit backfaces… Simplest solution is to make sea with two surfaces… one, that is facing down and has a mesh collider and a second one without collider, but with inverted normals (to see the sea surface and so you can be sure, that those two meshes are in sync)
Only persisting problem is, that these waves are extremely expensive and any plane larger than ~100x100 vertices is almost impossible to render fluently… It works beautifully when I turn off the mesh collider, of course 
This would be no problem, if the player boat would be the only one around, as you would make the plane with mesh collider fairly small and only around the player…
I guess the only solution is to calculate the function for the wave shape globally and assigning the y value based on the x and z coordinates… This way, you can have a small mesh collider for every boat, or to calculate the buoyancy directly by the “wave function”
Yes, that sounds like by far the best solution to me.