Player can't move when standing still while an animation is playing?
I was trying to play a crouch animation, to let the player crouch obviously, but for some reason, if I crouch while I'm standing still, or stand still while I'm walking, I am unable to move. It's a LocalScript with a RemoteEvent going to a ServerScript. Here is the LocalScript:
01 | player = game.Players.LocalPlayer |
02 | UserInputService = game:GetService( "UserInputService" ) |
03 | cam = game.Workspace.CurrentCamera |
05 | UserInputService.InputBegan:Connect( function (key,wtfwtf) |
06 | if key.KeyCode = = Enum.KeyCode.LeftControl then |
08 | game.ReplicatedStorage.Animator:FireServer(game.ReplicatedStorage.Animations.Crouch, true , true ) |
09 | game.ReplicatedStorage.Speed:FireServer( 4 ) |
13 | UserInputService.InputEnded:Connect( function (key,wtfwtf) |
14 | if key.KeyCode = = Enum.KeyCode.LeftControl then |
15 | game.ReplicatedStorage.AnimatorStop:FireServer() |
16 | game.ReplicatedStorage.Speed:FireServer( 16 ) |
And here is the ServerScript:
01 | game.ReplicatedStorage.Animator.OnServerEvent:Connect( function (player, anim, isMovement) |
03 | local animator = player.Character:FindFirstChild( "Humanoid" ):FindFirstChildOfClass( "Animator" ) |
04 | local anon = animator:LoadAnimation(anim) |
06 | if isMovement = = true then |
07 | anon.Priority = 'Movement' |
12 | game.ReplicatedStorage.AnimatorStop.OnServerEvent:Wait() |
Could someone figure out why this is happening?