Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I implant my crouch walk animation?

Asked by 5 years ago
Edited 5 years ago

I animated a crouching animation for a game I'm working on which you hold ''c'' your character gets in a low position and their walk speed is slow. The crouching animation is already scripted and works perfectly. I have already made a walking animation for it where if you try moving while you're in that crouching position only your legs move, But I can't find a way to implant that crouch walk animation into the game.

Here's the crouch animation:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Animate 
local Humanoid = player.Character:FindFirstChild('Humanoid')

if player.Character.Humanoid.Walkspeed > 0 then?
    local Animation = Instance.new("Animation", player.Character)
  Animation.AnimationId = "rbxassetid://2633841247"
  Animate = Humanoid:LoadAnimation(Animation)
  Animate:Play()

==========================================================================================================================================================

Video of what the crouching animation looks like: https://gyazo.com/d427b29ec06f88429bea89ea5f26c6c8

0
What do you mean by implant it into the game? If it works perfectly, then isn't it already in the game? SteamG00B 1633 — 5y
0
You cant script and trying help to ur friend? I guess you never be pro scripter only normal. Makz69 0 — 5y
0
No, the crouch animation works perfectly. But the crouch 'WALK' animation is the thing I'm having trouble putting in the game. If I press C my character gets in the crouch position but I want the characters leg's to move if he walks while hes in that position. Incinerxte 2 — 5y
0
You could bind it to walkspeed, so that if a player has the slower walkspeed, then the crouch walk animation plays SteamG00B 1633 — 5y

1 answer

Log in to vote
0
Answered by
SteamG00B 1633 Moderation Voter
5 years ago
Edited 5 years ago

Since I don't have your crouch walking animation script, I'm just going to use the one above to show you an example of how you could do it, you'd just have to substitute it for the correct animation though.

Also going to make this a bit easier for you, I changed it up so you would be able to just put the script into character scripts, so it would be in every character when they load into the game.


local player = script.Parent local mouse = game.Players.LocalPlayer:GetMouse() local Animate local Humanoid = player.FindFirstChild('Humanoid') local crouchSpeed = 15 -- just a random number that I picked which you would set to the max speed of crouch walk if player.Character.Humanoid.Walkspeed == crouchSpeed then local Animation = Instance.new("Animation", player.Character) Animation.AnimationId = "rbxassetid://2633841247" Animate = Humanoid:LoadAnimation(Animation) Animate:Play()

I obviously haven't tested this because of me not having the walking animation, but it should work with maybe some minor fixes I might have missed.

0
Thank you. Incinerxte 2 — 5y
0
The script is good, but just one error comes up in Output. "GetMouse is not a valid member of Model" Incinerxte 2 — 5y
0
change mouse = game.Players.LocalPlayer:GetMouse() SteamG00B 1633 — 5y
Ad

Answer this question