Raycast without collider

Is there a way for my raycast to know when it hit an object without a collider? I am makin an FPS game and my capsule collider is not really modeled to my mesh and if i checked wether that collider is hit it would be really dumb because i could kill the player without even pointing at any of his body parts. Thx.

If you want collision detection on your mesh you have to use a mesh collider. This is not really advised, however, because of how computationally expensive it is to recompute the collider each frame. If you’re targeting PCs then you might be able to get away with it for a few objects, but too many will cause a noticeable dip in frame rate. Mesh colliders, if used at all, are best used on static geometry that won’t change or move (I.e. a chair, not a player character).

There really isn’t anything wrong with using a capsule either. Its not really dumb, and a lot of games work this way in order to save computation time for other things that were deemed more important in the development cycle. Everything is a trade off, however, and if your game revolves around ‘per-pixel hit detection’ then that’s where you spend your resources.