How do i make that the player can only shoot in front of him/her?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? i want the player to only shot in front of him/her

  2. What is the issue?

  3. What solutions have you tried so far? i tried searching on youtube

You can make the player in the first person

yes that would work but i dont want the player to be in first person mode

local player

player.CameraMinZoomDistance = 0.5
player.CameraMaxZoomDistance = 0.5

originate the bullet to come from the gun instead of the camera

Or:

Change that properties from StarterPlayer.

ok here’s another sketch hope you’ll understand it

You can check the orientation from the camera CFrame. And check if the “X” axis it’s lower than 45 deg and higher than -45 deg.

And with the max shoot distance you can check the magnitude from the camera cframe position and the mouse hit position.