Issues With My Gun System

I need some help. . .
Recently I’ve been working on my own Gun system that I want to be completely made from scratch. The goal is for it to be entirely modular, and be able to be used in all instances and games. It currently accomplishes my goal, but I have run into a major issue:

I don’t know how to Make the Upper Torso consistently face the mouse?
This is what I think will solve the problem, The problem is presented here in this video: Video Example --//Apologies for the low volume.

But for those of you who don’t want to watch a 5 minute video, here’s a quick summary; I am using LocalTransparencyModifier to create “FPS arms” instead of using actual FPS arms or Viewmodels. My reasoning is that I want this to work in all instances, and my system is built around Animations. Currently the Camera is going inside of my character, I believe this is because the Camera is Subjected to the HumanoidRootPart? This is an example of the problem;

CameraProblem

I know that this can be fixed by disabling my current “Head/Torso Follow Mouse” script, but that still defeats the purpose. I need the Gun and Arms to FOLLOW my mouse. Not be stagnant.

Things I have Tried: I have tried to weld portions of the gun onto my character. I have also tried to create an artificial part called “PlayerChasis” that would be a gyroscope for the Torso. None of these Have worked.

Reminder Of Objective: I am not trying to re-write my entire system, nor am I trying to do little work. I’m looking for concepts or even just straight up code if need be. The point of the system is to be modular and have good performance. Not necessarily look like Call Of Duty. Remember that the goal is to make the player ultimately face the mouse so that the tool comes with it, However, I am open to overall criticism and feedback, this is just as much as a plea for help as it is a discussion.

The Only Portion that Touches the Camera in my Code is below;

M.Button2Down:Connect(function()
		if script.Parent.Equipped then
			framecross.Size = UDim2.new(UDim.new(0,25),UDim.new(0,25))
			aimAnim:Play()
			aiming = true
			UIS.MouseIconEnabled = false
			hum.CameraOffset = Vector3.new(0.09,0.235,-1.25) --Fine Tune to Sight-Line
			--//--
			for i = 1,script.Parent.Source.Checks.AimMultiplier.Value do
				game.Workspace.CurrentCamera.FieldOfView = (70-(i*2))
				wait()
			end
		end
		M.Button2Up:Connect(function()
			if script.Parent.Equipped then
				framecross.Size = UDim2.new(UDim.new(0,50),UDim.new(0,50))
				aimAnim:Stop()
				aiming = false
				UIS.MouseIconEnabled = true
				hum.CameraOffset = Vector3.new(0,0,-0.75)
				for i = 1,script.Parent.Source.Checks.AimMultiplier.Value do
					game.Workspace.CurrentCamera.FieldOfView = (70+(i*2))
					wait()
				end
			end
		end)
	end)

Thank you!

Here’s the Game link if you’re interested or need more info on the Problem. GAME

I suggest you look into CFrame.fromMatrix for getting the torso to be aligned with the camera, but not move up and down or follow the mouse.

The post above will help you CFrame.fromMatrix

Then for the arms you could just make their respective Weld’s C0 or C1 face the mouse, doing this will not affect the CFrame of the torso or other limbs at all. Unfortunately, I don’t exactly know this type of math off the top of my head :sweat_smile: so you’re going to have to figure out how to make the arms follow the mouse by yourself. Hope this helps a bit!

Thanks! I’ll definitely look into this.