So I have an axe, and when the axe is equipped, if the player clicks on a tree, the tree will get chopped.
On computer it works perfectly fine but on mobile it doesn’t work. It’s because I used the :GetMouse() and the mouse.Target to detect if the tree is clicked.
So is there a similar function for mobile? I searched and can’t really find a way to detect if a part is clicked on mobile when a tool is equipped.
If possible, I don’t want to use click detectors for this.
For devices with a mouse connected I use this script
connectionA = mouse.Button1Down:Connect(function()
debounce = true
if mouse.Target and mouse.Target.Parent and mouse.Target.Parent:IsA("Model") and LocalPlayer.Character.HumanoidRootPart then
ChopTree(mouse.Target)
end
task.wait(debounceTime)
debounce = false
if connectionA then
connectionA:Disconnect()
end
end)
If possible I want to do something similar for devices with no mouse connected
Thanks in advance