'Mouse.Target' Doesn't Seem To Work

Hey there,
I’m trying to create a tool that when clicked on an object with (in this instance, a tree) it would damage the tree, but my script doesn’t seem to work or give any errors.
I’ve tried adding prints to see where the issue is, and it seems to only make it up to line 13, so I assume it’s something to do with the Mouse.Target
Any help wouuld be appreciated, thank you!

Here is the script (localscript inside the tool)

wait()
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char.Humanoid
local anim = hum:LoadAnimation(script.Parent.SwingAnim)
local mouse = player:GetMouse()

local tree = game.Workspace.Map.Biomes.Grasslands.Trees.Oak

local cooldown = false

script.Parent.Activated:Connect(function()
	if script.Parent.Equipped then
		if mouse.Target == tree then
			if cooldown == false then
				print('Code works!')
			
				anim:Play()
				cooldown = true
				wait(1.5)
				cooldown = false
			end
		end
	end
end)

equipped is an event for when the tool is equiped

also there is no reason to check if it’s equipped because the player just activated the tool, it’s obviously equipped.

if script.Parent.Equipped then

I removed that line of code and tried it again, but still nothing seems to be working.

also humanoid:LoadAnimation() is deprecated

do something like this instead

local humanoid = Character:WaitForChild("Humanoid")-- you don't even need a humanoid var
local animator = humanoid.Animator 
local animation = animator:LoadAnimation(animationTrack)-- load animations with 'Animator' instead of 'Humanoid' 

more info on animator