Right click animation play without tool

Im creating a tool without using roblox’s premade tool thing. I want to make it so when you right click it plays a aiming down sights animation.

local player = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local character = player:WaitForChild("Character")
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://4526383308"
local track = character.Humanoid:LoadAnimation(Anim)
UserInputService.InputBegan:Connect(function(InputObject)
if InputObject.UserInputType == Enum.UserInputType.MouseButton2 then
Anim:Play()
end
end)

I’ve looked all over the forum, all i could find were animations played on tools.
I’m just trying to create a functional pseudo tool.

4 Likes

This should be track:Play().

1 Like

oop thanks maybe i shouldn’t code late at night haha

1 Like