What do you want to achieve?
update core animations when some script changes core animations id.
so im making a game with abilytes, and one of the abilitys changes core animations but the animations updates only when player move, how i can update animations so they start playing after animation id had changes
Update default character’s Animate script to add this logic.
Default one preloads animations and keeps loaded AnimationTracks,
so following simple changing Animation Id would not work.
I also think modifying the animate script would be the best way.
To do that, create a rig. Then move the “animation” script from inside the rig to
StarterPlayer->StarterCharacterScripts. Open it and scroll to the very bottom.
You should see this:
-- main program
-- initialize to idle
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
while Figure.Parent ~= nil do
local _, time = wait(0.1)
move(time)
end
add this between "pose = standing" and "while Figure.Parent~=nil do":
for index,object in ipairs(script:GetChildren()) do
if object:IsA("StringValue") then
object:FindFirstChildWhichIsA("Animation").Changed:Connect(function()
stopAllAnimations()
end)
end
end
thank you for help!
for those who making something like that and want to play anims immediately, paste this:
for index,object in ipairs(script:GetChildren()) do
if object:IsA("StringValue") then
object:FindFirstChildWhichIsA("Animation").Changed:Connect(function()
stopAllAnimations()
playAnimation("idle", 0.1, Humanoid)
end)
end
end