[HELP] Movement Animations Showcase/Feedback and help

Ever since i’ve developed in studio i’ve been wondering how to change the walk, run and jump animations.

One time I asked GPT, for a solution and when he gave me the script i almost wanted to throw gpt out of my window.. TRASH, but i mean gpt checks all internet so how did he get it wrong…

THEN MY IDEA WAS BORN:

“why dont i ask the super smart developers in forum”
_________________________________________________+Clear+

So if one of yall have a script that changes the animations or just teaching me how to do it.. I WOULD ABSOLUTELY APPRECIATE IT

my system rn:

local script (starterplayer):

– StarterPlayerScripts/ShiftToRun.lua
local UserInputService = game:GetService(“UserInputService”)
local Players = game:GetService(“Players”)
local RunService = game:GetService(“RunService”)

local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild(“Humanoid”)
local animator = humanoid:WaitForChild(“Animator”)

– Speeds
local WALK_SPEED = 16
local RUN_SPEED = 36

local WALK_ID = “113125122325043”
local RUN_ID = “92803265229779”
local JUMP_ID = “96859024100057”
local STOP_ID = “101773556814911”

– State
local isRunning = false
local cameraShakeConnection

– Load Animations
local function loadAnim(id, priority, looped)
local anim = Instance.new(“Animation”)
anim.AnimationId = “rbxassetid://” .. id
local track = animator:LoadAnimation(anim)
track.Priority = priority
track.Looped = looped
return track
end

local walkTrack = loadAnim(WALK_ID, Enum.AnimationPriority.Movement, true)
local runTrack = loadAnim(RUN_ID, Enum.AnimationPriority.Movement, true)
local jumpTrack = loadAnim(JUMP_ID, Enum.AnimationPriority.Action, false)
local stopTrack = loadAnim(STOP_ID, Enum.AnimationPriority.Action, false)

– Helper Functions
local function stopAllMovementAnims()
walkTrack:Stop(0.1)
runTrack:Stop(0.1)
end

local function startWalking()
stopAllMovementAnims()
task.wait(0.05)
walkTrack:Play(0.2)
end

local function startRunning()
stopAllMovementAnims()
runTrack:Play(0.2)
end

– Camera Shake effect
local shakeIntensity = 0
local baseCFrame = camera.CFrame

local function startCameraShake()
if cameraShakeConnection then return end
local t = 0
cameraShakeConnection = RunService.RenderStepped:Connect(function(dt)
t += dt * 8
local offset = Vector3.new(
math.sin(t * 2.5) * shakeIntensity,
math.cos(t * 3.5) * shakeIntensity / 2,
0
)
camera.CFrame *= CFrame.new(offset)
end)
end

local function stopCameraShake()
if cameraShakeConnection then
cameraShakeConnection:Disconnect()
cameraShakeConnection = nil
end
end

local function tweenShake(target)
task.spawn(function()
local step = (target > shakeIntensity) and 0.01 or -0.01
while math.abs(shakeIntensity - target) > 0.01 do
shakeIntensity += step
task.wait(0.02)
end
shakeIntensity = target
end)
end

– Running / Walking logic
local function beginRunning()
if isRunning then return end
isRunning = true
humanoid.WalkSpeed = RUN_SPEED
startRunning()
startCameraShake()
tweenShake(0.15)
end

local function endRunning()
if not isRunning then return end
isRunning = false
humanoid.WalkSpeed = WALK_SPEED

stopAllMovementAnims()
stopTrack:Play(0.05)
stopTrack.Stopped:Wait() 
startWalking()

tweenShake(0)
task.wait(0.3)
stopCameraShake()

end

– Jump handling
humanoid.StateChanged:Connect(function(_, state)
if state == Enum.HumanoidStateType.Jumping then
stopAllMovementAnims()
jumpTrack:Play(0.1)
elseif state == Enum.HumanoidStateType.Landed then
if isRunning then
startRunning()
else
startWalking()
end
end
end)

– Shift handling
UserInputService.InputBegan:Connect(function(input, processed)
if processed then return end
if input.KeyCode == Enum.KeyCode.LeftShift then
beginRunning()
end
end)

UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
endRunning()
end
end)

– Respawn handling
player.CharacterAdded:Connect(function(char)
character = char
humanoid = char:WaitForChild(“Humanoid”)
animator = humanoid:WaitForChild(“Animator”)
end)

Movement Fix (local script in starterplayerscripts):

– LocalScript in StarterPlayerScripts
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild(“Humanoid”)

local idleTime = 1 – seconds to wait before stopping animations
local currentIdle = 0

– Store currently playing animations
local playingAnimations = {}

– Listen to animations being played
humanoid.AnimationPlayed:Connect(function(track)
table.insert(playingAnimations, track)
end)

– Check movement every 0.1 seconds
spawn(function()
while true do
wait(0.1)
if humanoid.MoveDirection.Magnitude == 0 then
currentIdle = currentIdle + 0.1
if currentIdle >= idleTime then
– Stop all playing animations after 3 seconds idle
for _, track in ipairs(playingAnimations) do
if track.IsPlaying then
track:Stop()
end
end
– Clear the table so we don’t try to stop old tracks repeatedly
playingAnimations = {}
end
else
currentIdle = 0 – reset idle timer when moving
end
end
end)

---- SOOO basically the movement fix just stops all animations when idle because i suck at this with animations and stuff:

– i had a showcase video but forums doesnt let me upload large videos SO SORRY

You can directly change the animations script. Play the game and copy the local script titled, “Animate” inside of your character. Paste it into StarterCharacterScripts after you end the testing session. You can change the animation by going into the string values and changing the ID of its child to your animation ID.

1 Like

doesnt work i swear, i’ve tried everything

You marked me as the solution, so did it work? If not, I may be able to try and help you further

does the animation have to be a certain way… does it work for r6 and r15… idk it fr doesnt work for me

if you had an r15 rig, the animation script in your character would have the r15 animation ID’s.

no like i made the animation, published it… copied the id and pasted it on the animate script i put in characterscripts and it still doesnt work

Thats odd, could you show me a screenshot of your explorer window? Also show me where you’re putting the animation ID’s.

Also let me know in what way its not working. Does your character not have any animations? Is your character still using the default animations? etc.

Don’t put it in the animate script. instead, put it inside the animation instance that is the child of the base value that is named your anim. in other words, where it says run, open that and put the animation id inside of that. it will trigger when you run

i did that i just resumed… yes so in the animation value i put in my animation id, (the run value>runanimation)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.