So I have enounctered this error which says "Unable to cast value to objest" while loading an animation, and it doesn't say anything else, didn't find anything useful about this. And no i don't need debounce, and IsTyping, just need a fix for this, if possible.
Code:
wait(2) local Character = game.Players.PineRox.Character local UIS = game:GetService("UserInputService")
local Animation = Instance.new("Animation") Animation = 'rbxassetid://4682522673'
UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.F then local LoadAnimation = Character.Humanoid:LoadAnimation(Animation) LoadAnimation:Play() end end)
wait(2) local Character = game.Players.PineRox.Character local UIS = game:GetService("UserInputService") local Animation = Instance.new("Animation") Animation.AnimationId = 'rbxassetid://4682522673' --here's the error you need to put .AnimationId not the object animation UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.F then local LoadAnimation = Character.Humanoid:LoadAnimation(Animation) LoadAnimation:Play() end end)