I created this script to play an animation while seating but it doesnt work , it work with an ordinary roblox animation but when i use mine it doesnt work ... I already choose all stage of permission but it doesnt work .
Here the sript:
local seat = script.Parent function SeatIsSatIn(hit) if hit.Parent:FindFirstChild("Humanoid") then local character = hit.Parent local humanoid = character.Humanoid wait(0.5) if humanoid:GetState() == Enum.HumanoidStateType.Seated then local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://3160530487" local track = humanoid:LoadAnimation(animation) track:Play() local function StateChanged(oldState, newState) if newState ~= Enum.HumanoidStateType.Seated then track:Stop() end end humanoid.StateChanged:connect(StateChanged) end end end seat.Touched:connect(SeatIsSatIn)
It could be that the priority of the animation isnt right, like with the animation editor you can change the priority of animations (Meaning if they overlap another animation, say if i was running but i want to have an animation ontop while im holding something, you would change the priority to movement or action)