Hello guys!
So I am having this problem here where I make a animation (very bad, I’m new to animation) with markers. Now inside of my script, I tell it to pause, but it pauses with delay. Here is some context below:
Animation when first event “Charge” hits:
Animation when second event “Transformation Start” hits:
Animation when third event “Transformation” hits:
Take a look at the script btw to see if anything is wrong there:
--//Services
local RS = game:GetService("ReplicatedStorage")
local SS = game:GetService("ServerStorage")
local PS = game:GetService("Players")
local TS = game:GetService("TweenService")
local RunS = game:GetService("RunService")
--//Modules
local ServiceInfrastructureSS = require(SS:WaitForChild("Services").Infrastructure.ServiceInfrastructureSS)
--//Assets
local RageMeterAssets = ServiceInfrastructureSS.GetServiceAssets("AbilityService")["Rage Meter"]
local RagedTransformationAssets = RageMeterAssets["Raged Transformation"]
local TransformationVFX = RagedTransformationAssets.VFX.Transformation
local CharacterVFX = RagedTransformationAssets.VFX.Character
local Animations = RagedTransformationAssets.Animations
--//Remotes
local ServiceInfrastructureRS = require(RS:WaitForChild("Services").Infrastructure.ServiceInfrastructureRS)
local RageMeterRemotes = ServiceInfrastructureRS.GetServiceRemotes("AbilityService")["Rage Meter"]
local RagedTransformationRemotes = RageMeterRemotes["Raged Transformation"]
--//Module Functions
local Functions = {}
function Functions.Execute(Player)
local Character = Player.Character
local Humanoid = Character:FindFirstChild("Humanoid")
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
if not Character and not Humanoid and not HumanoidRootPart then return false end
local AnimationTrack = Humanoid.Animator:LoadAnimation(Animations.Transformation)
local TransformationBox = TransformationVFX.TransformationBox:Clone()
TransformationBox.Parent = workspace
TransformationBox:PivotTo(HumanoidRootPart.CFrame)
--Camera
RagedTransformationRemotes.Camera:FireClient(Player, "Start", TransformationBox.Camera.CFrame)
task.wait(1.3)
AnimationTrack:Play()
task.spawn(function()
for i, v in pairs(TransformationBox.ChargeBox:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Enabled = true
end
end
task.wait(3)
for i, v in pairs(TransformationBox.ChargeBox:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Enabled = false
end
end
end)
--Charge
AnimationTrack:GetMarkerReachedSignal("Charge"):Connect(function()
print("Charge reached.")
AnimationTrack:AdjustSpeed(0)
task.wait(3 + TransformationBox.ChargeBox.LargeCharge.Lifetime.Max)
AnimationTrack:AdjustSpeed(0.5)
end)
AnimationTrack:GetMarkerReachedSignal("Transformation Start"):Connect(function()
AnimationTrack:AdjustSpeed(1)
print("Reached Animation Start")
end)
--Transformation
AnimationTrack:GetMarkerReachedSignal("Transformation"):Connect(function()
print("Transformation reached.")
AnimationTrack:AdjustSpeed(0)
for i, BodyPart in pairs(Character:GetChildren()) do
if BodyPart:IsA("BasePart") and BodyPart ~= HumanoidRootPart then
--Clone VFX
for i, v in pairs(CharacterVFX.BodyParts:GetChildren()) do
if v:IsA("ParticleEmitter") then
local Clone = v:Clone()
Clone.Parent = BodyPart
Clone.Enabled = true
end
end
end
end
task.wait(3)
AnimationTrack:AdjustSpeed(0.5)
--End and Clear
RagedTransformationRemotes.Camera:FireClient(Player, "End")
for i, v in pairs(TransformationBox:GetDescendants()) do
if v:IsA("ParticleEmitter") then
TS:Create(v, TweenInfo.new(2, Enum.EasingStyle.Linear), {Rate = 0}):Play()
end
end
task.wait(3)
TransformationBox:Destroy()
return true
end)
end
return Functions
(Now this is a test ability, no cooldowns or other implemented systems. I’m just testing out my animation and vfx for now.)
Here is a video of me doing the ability:
Now clearly this should not happen first off, as the first event has the hands touching:
You see the hands touch AFTER the pause for the “charge”. Everything after that is also delayed from the actual animation. BTW here is the prints as you can see:
All events are reached fully.
Please help, and thanks for stopping by!