#I need help

1 messages · Page 1 of 1 (latest)

glad willow
#

This animation is restarting repeatedly i think its an issue on the renderstepped function can someone please check it out and yes i did use another module script to handle the animations.

#

--- Services
local Players = game:GetService("Players")
local StarterPlayer = game:GetService("StarterPlayer")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
--- Modules
local AnimController = require(StarterPlayer.StarterPlayerScripts.Client.Controllers:WaitForChild("AnimController"))
local AnimConfigs = require(StarterPlayer.StarterPlayerScripts.Client.Configs:WaitForChild("AnimConfig"))

--- Player & Character
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")

--- Animations
local Animations = ReplicatedStorage:WaitForChild("Animations")
local SprintAnimation = Animations:WaitForChild("Sprint")

--- Initialize
local AnimControllerInstance = AnimController.new(Animator)

--- Booleans
local Clicked = false



local SprintHandler = {}

function SprintHandler.Start()
    local FadeTime = AnimConfigs.Config.Sprint.FadeTime
    local Weight = AnimConfigs.Config.Sprint.Weight
    
    
        
    UIS.InputBegan:Connect(function(Input, isProcessed)
        if isProcessed then return end
    
        if Input.KeyCode == Enum.KeyCode.LeftShift then
            Clicked = not Clicked
            RunService.RenderStepped:Connect(function()
                if Clicked and Humanoid.MoveDirection.Magnitude > 0 then
                    AnimControllerInstance:Play(SprintAnimation)
                else
                    AnimControllerInstance:Stop(SprintAnimation)
                end
            end)
        end
    end)
    

end

return SprintHandler
lilac hill
#

i cant exactly figure out what's supposed to happen with the sprint animation

#

or what sprinthandler does

glad willow
#

just like any sprint aniamtion

#

leftshit to sprint

#

if u stop

#

anim stops

lilac hill
lilac hill
glad willow
#

yes but i will be writing more animations

#

and i just use an animationhandler for that

maiden moonBOT
#

studio** You are now Level 4! **studio

glad willow
#

to no repeat it

lilac hill
#

no like

#

multiple Sprint animations you mean or

#

more animations

glad willow
#

more anims

lilac hill
#

for like walk or jump right

glad willow
#

no i'll add combat tp

neon nova
#

priority maybe?

glad willow
#

to

glad willow
lilac hill
#

i just added a shift to Sprint script and run animation from just searching it in models, and all other animation ids are put in starterplayer something > Animate

maiden moonBOT
#

studio** You are now Level 3! **studio

glad willow
#

local script is different than that

lilac hill
glad willow
#

yes but thats somthing else

#

there is no sprinting there

#

ony walking

lilac hill
#

that's where i downloaded the shift to run script

#

free virus free works like a charm

#

there's like hundreds of it

#

doing it yourself is just a learning experience

#

well whatever I'll get out of your hair I'm probs misunderstanding anyway

#

won't be of much help