I've tried loads and loads of different methods to create key~bind animations, but none of them work. Even if I follow the tutorial It always shows the same error in output: ****Keycode Is Not A Valid Member Of InputObject...**** Can anyone help please? Here is the script if you need it:
local plr = game.Players.LocalPlayer local char = plr.Character local human = char:WaitForChild("Humanoid") local uis = game:GetService("UserInputService") local anim = Instance.new("Animation") anim.AnimationId = "rbxassetid://02762264324" function onKeyPressed(inputObject, gameProcessEvent) if inputObject.Keycode == Enum.KeyCode.A then human:LoadAnimation(anim):Play() print("Animation is playing") end end uis.InputBegan:Connect(onKeyPressed)
I put the script in StarterGui, StarterPack... EVERYWHERE, is this a problem with my device or roblox studio?
This is because roblox is sensitive when it comes to capitalization. Make sure to spell "Keycode" as: "KeyCode" make sure the "c" is capital.