Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

Is it possible to make animations that go idle after complete?

Asked by
acecateer 130
9 years ago

I've been scripting a bow and I've gotten up to the point of animating it, I want to make an animation using the ROBLOX animation creator plugin but I don't know if what I want to do is possible... What I want to do is make an animation that whenever someone holds down the left mouse button it draws the arrow back slowly until it get's to full strength then stays there until they release. Is it possible to make an animation that has the animation of drawing their arms back and then it stays at the ending position until the animation is stopped? I'm not asking for scripts, but sources would be nice.

1 answer

Log in to vote
3
Answered by 9 years ago

Good question, my answer would be to just try it out and see if the animation resets or if it stops at the last keyframe.

If it does reset, there is a workaround for your problem. First load an animation on the humanoid, play it, and use the event .KeyframeReached to weld the arms solid when the last keyframe is reached:

local animTrack = humanoid:LoadAnimation(Animation)
local animTrack:Play()
animTrack.KeyframeReached:connect(function(keyframe)
    if keyframe == "DesiredKeyframe" then
        LAW = Instance.new("Weld", character["Left Arm"]) -- Left Arm Weld
        LAW.Part0 = character.Torso
        LAW.Part1 = character["Left Arm"]
        LAW.C0 = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),0,0) -- Offset * Angle (Use math.rad() to set an angle in degrees)

        -- repeat process for right arm
    end
end)

I may be right, I may be wrong if I say that destroying these welds will allow the arms to go back to their normal position again.

2
I figured out an easier way earlier, I used the KeyframeReached Event and named some of the keyframes to set when I wanted the animation to freeze, and to freeze it I just used :AdjustSpeed and set it to 0 then when they release I put it back at the default speed. Thanks for the help anyways! :D acecateer 130 — 9y
0
That is actually way more efficient than what I tried to do. Good one! juzzbyXfalcon 155 — 9y
0
Thanks :P acecateer 130 — 9y
Ad

Answer this question