How Should I Deal With Shooting?

So i was exploring the new FPS template and I saw how it deals with shooting on the client and transferring data to the server to recalculate the rays to see if it was a valid hit. I was wondering what are the benefits from doing this or is dealing with shooting on the server a valid option as well?

The main benefit of this is to do the initial calculations and animations on the client so that users will see a clean response when they fire the weapon. This way, there won’t be a delay from when they shoot, they send information to the server, the server completes the calculations, and then send a message back to the client to animate and visualize the shooting.

So, while making initial calculations on the client for the visuals is fine, these systems usually re-calculates on the server, as you mentioned. That would be to verify that the player can’t exploit to shoot through walls or do something they shouldn’t be allowed to.

To answer your second question, yes, doing all of that solely on the server is a valid option. Though that would depend heavily on how the gun system works. For an FPS gun system, I definitely wouldn’t recommend it, as fast, responsive visuals are very critical there, and the feedback from the server would simply be too slow.