- Home /
raycast not working after mesh deformed via shader
So big progress on the TBS map and province selector. I was able to incorporate my heightmap in the shader which is awesome. I was totally surprised at how well it worked and how great it looks.
PRoblem is that now my raycast province selector doesn't quite work.. If I flatten out my mesh, it works great, but when I turn up the displacement, I'll click on a province and get like the next one over. I assume this is because while the mesh is displaced, the collidor is still a flat plane?
So how would I go about fixing this up?
List item
Answer by Jerry-FFG · May 18, 2018 at 07:09 AM
I think a shader won't help you here -> i guess you will have to deform your mesh on the cpu and then update the collider as well - as described here: https://forum.unity.com/threads/changing-collider-shape-based-on-vertex-shader.471461/