I have a script that generates randomly generated Islands. The problem is when I call a raycast to the island the raycast doesn't hit it. The Island does have an enabled mesh collider (which it the generated one). I found that when I go to the inspector, set mesh collider mesh to none, then back to the island, disable mesh collider and then re-enable the collider will make it work with raycasting. However when I do that throught script it doesn't work!
↧