How do I make the camera point where the gun points

I am making a gun that you use in first person, but I don’t know how to make it so that the gun points where the camera is pointing.

This I how I tried to do it

Server Script

game.ReplicatedStorage.HoldAssaultRifleEvent.OnServerEvent:Connect(function(player, gun, cam, mouse)
	player.CameraMode = Enum.CameraMode.LockFirstPerson
	while wait() do
		if cam ~= nil then
			local char = player.Character
			
		end
	end
end)

Local Script

script.Parent.Equipped:Connect(function(mouse)
	workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
	workspace.CurrentCamera.CFrame = player.Character.Head.CFrame
	game.ReplicatedStorage.HoldAssaultRifleEvent:FireServer(gun, workspace.CurrentCamera, mouse)
end)
1 Like

Hello again! If you want to make your gun follow your cursor then there’s a really good tutorial on youtube made by TechwithMike that can help you. His videos go in depth to making a full FPS game. Hopefully this helps you out!
https://www.youtube.com/watch?v=hhXTj7lcaTg&ab_channel=TechwithMike