- Home /
Mesh Collider Issue(?) - Raycast (ScreenPointToRay) Appears to Collide on Nothing
I am making an fps game using raycasting to aim. My aiming system is working fine except sometimes the raycast seems to collide on absolutely nothing:
The raycast seems to end in midair, notably just above the edge of that "stair" mesh. This happens at other specific locations in this test level, always at points that seem to be parallel to edges or faces of the level mesh. This leads me to believe it's an issue with the mesh collider assigned to the level mesh, but its collider works fine interacting with the player object. I do not have a ton of experience working with colliders so if anyone has an idea what might be wrong I would appreciate it. (I realize I could use multiple primitive colliders for this simple of a model, but there will be more complex models in the game so I'd like to solve the problem without doing that.)
Of course there's also the possibility it could be something unrelated to the mesh or its mesh collider, but since this problem occurs at very specific locations in the level I doubt that's the case.