Hold mouse not working

I want the aim animation to play when holding the RM button and stop when released.

Video shows the issue

I’ve looked on the developer forum but nothing works…

local mouse = game.Players.LocalPlayer:GetMouse()
local TweenService = game:GetService("TweenService")
local UIS = game:GetService("UserInputService")
local g = workspace.CurrentCamera:WaitForChild("m1")
local e = game.StarterPlayer.StarterCharacterScripts.m1
local value = g:WaitForChild("Aiming")
local tweenInfo = TweenInfo.new(1)
local anim = g.Animation:LoadAnimation(g.e)
local part = workspace.CurrentCamera
local m = false
mouse.Button2Down:Connect(function()
	print("hold")
	m = true
	local goal = {}
	goal.FieldOfView = 60
	while m == true do
		wait()
		local tween = TweenService:Create(part, tweenInfo, goal)
		tween:Play()
anim:Play()
	end



end)
mouse.Button2Up:Connect(function()
	m = false
	if m == false then
		local goal = {}
		goal.FieldOfView = 70
		local tween = TweenService:Create(part, tweenInfo, goal)

		tween:Play()

	end
	anim:Stop()
	print("released")
end)


Ask me if you need the rbxl

Is it possible that your mouse button has dirty contacts and isn’t staying closed 100% while holding it?
You can try using mousebutton1 instead to see if the ‘hold’ & ‘released’ prints continue.

thats not it… I’ve tried it and I get the same results.
Untitled Game.rbxl (294.0 KB)
Try out for yourself

That’s odd. It works for me, and I made no modifications to your code.