So i made my own Animation system for viewmodels and it works but!!
Whenever i want to cancel the Animation it does to the idle Animation but then will still continue the old animation
This is not the whole script btw
This part of the script is in a Function and fires when ever i do a MouseButtonClick or a KeyCode
for i,Key in pairs(AAFchildren) do-- goes through the animation folder
-- this part is for finding welds
for _,ViewmodelWeld in pairs(Viewmodel:GetDescendants()) do-- looks through the viewmodel to find motor6ds
if ViewmodelWeld:IsA('Motor6D') then
for _,KeyframeWeld in pairs(Key:GetDescendants()) do-- looks through the keyframe to find motor6ds
if KeyframeWeld:IsA('Motor6D') then
if ViewmodelWeld.Name == KeyframeWeld.Name then-- if the viewmodel weld and keyframe name are the same
TweenService:Create(ViewmodelWeld, TweenInfo(TweenTime*Speed, EasingStyle[TweenEasingStyle], EasingDirection[TweenEasingDirection]), {C1 = KeyframeWeld.C1}):Play()
end
end
end
end
end
end
mind showing the full code? because my brain sucks at understanding words that are NOT in a coding language
also to get something like “left mouse button” released just do UserInputService.InputEnded then check for userinputtype “MouseButton2”
and if youre talking about trying to stop a tween that is made by a different part of a code and the function doesnt know of the code, just try to pass the tween to the function
this is literally your “pairs” without sugar.
Try looking at what your pairs function actually returns. print(pairs({})) → function: 0xe87028781e9b508f {} nil