You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to remove flickering from my animations, I’m not a very experienced programmer and i’ve tried using ChatGPT and Assistant, but both seem unable to fix the issue. -
What is the issue? Include screenshots / videos if possible!
Flickering between different animations -
What solutions have you tried so far? Did you look for solutions on the Creator Hub?
ChatGPT and Assistant, but I have not looked on the Creator Hub.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Here’s my animation player.
-- Apply lerp between frames
function Animator:ApplyFrameLerp(frame1, frame2, alpha)
local rootPart = self.Character:FindFirstChild("HumanoidRootPart")
if not rootPart then return end
for partName, joint in self.Joints do
if not (joint and joint:IsA("Motor6D")) then continue end
local c1 = self:GetCFrameFromFrame(frame1, partName)
local c2 = self:GetCFrameFromFrame(frame2, partName)
local blended = c1:Lerp(c2, alpha)
local base = self.Defaults[partName]
if base then
joint.C0 = base * blended
end
end
end
What i’m trying to do with a script:
local Character = script.Parent
local SprintEvent = Character:WaitForChild("Event")
local Humanoid = Character:WaitForChild("Humanoid")
local WALK_SPEED = 16
local SPRINT_SPEED = 32
local CFrameAnimator = require(game.ReplicatedStorage:WaitForChild("CFrameAnimator"))
local Animator = CFrameAnimator.new(Character)
local CurrentState = nil
local Animations = game.ReplicatedStorage:WaitForChild("Animations")
local IdleAnim = Animations:FindFirstChild("idle")
local WalkAnim = Animations:FindFirstChild("walk")
local RunAnim = Animations:FindFirstChild("run")
-- Track last known movement
local LastMoveDir = Vector3.new()
local Sprinting = false
-- Debounce for event handling
local lastEventTime = 0
local EVENT_COOLDOWN = 0.1 -- seconds
local function PlayStateAnimation(state, speed)
-- Only change animation if state actually changes
if CurrentState == state then
return
end
CurrentState = state
if state == "Idle" and IdleAnim then
Animator:Play(IdleAnim, 1)
elseif state == "Walk" and WalkAnim then
Animator:Play(WalkAnim, 1)
elseif state == "Run" and RunAnim then
Animator:Play(RunAnim, 3)
end
end
-- Receive input from client
SprintEvent.OnServerEvent:Connect(function(player, sprinting, moveDir)
local now = tick()
if now - lastEventTime < EVENT_COOLDOWN then
return -- Ignore rapid repeated events
end
lastEventTime = now
Sprinting = sprinting
LastMoveDir = moveDir
Humanoid.WalkSpeed = sprinting and SPRINT_SPEED or WALK_SPEED
if sprinting and moveDir.Magnitude > 0 then
PlayStateAnimation("Run", 3)
elseif moveDir.Magnitude > 0 then
PlayStateAnimation("Walk", 1)
else
PlayStateAnimation("Idle", 1)
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.