#I need help
1 messages · Page 1 of 1 (latest)
--- 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
i cant exactly figure out what's supposed to happen with the sprint animation
or what sprinthandler does
you don't need much scripting for that
you need 1 script for that
yes but i will be writing more animations
and i just use an animationhandler for that
** You are now Level 4! **
to no repeat it
more anims
for like walk or jump right
no i'll add combat tp
priority maybe?
to
let me see
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
** You are now Level 3! **
in a module script?
local script is different than that
• starterplayer/startercharacter
Animate
#walk
#run
#jump
etc