So i have made a function that will allow me to change the poses of a given weld or part by adjusting their cframes but how can i have it detect if it has been called while it is still running ? like for example if i made the right arm go up in 10 seconds total time waited 5 seconds then made it go down in how could i make the function detect that the first animation was not finished cancel it then execute the second animation?
here is the function
local frames = 25
local function newPose(joint, finishCFrame, length)
coroutine.resume(coroutine.create(function()
local totalDurration = length * frames
local i = 0
while true do
joint = joint:lerp(finishCFrame, i)
wait(1 / frames)
i = i + (1 / totalDurration)
if i == totalDurration then break end
end
end))
end

3 comments
how could i implement it then if i had to work with several different objects
and to add another layer how could i make it so some animations are overriden by some animations but not others?
I am unsure what you mean by different objects(scripts??) but if it is like different welds you could use a dictionary and the index would be the object you want to effect. Example running= { ["arm"]="No" } That way you can do the check for the right object... I don't know if that is what you meant.