Animation Question

Hello,

I was wondering how I could make a rig or character go back to its default position with no animations. Stopping the animations wouldn’t work as it just stays in the last frame where it was stopped at. I want to reset it to a point as if there was no animate script at all.

Thanks!

4 Likes

To completely stop and animation you would do Animation:Stop(). To pause an animation would be: Animation:AdjustSpeed(0).

No thats not my goal. I’m trying to reset the rig or character to the default position. To see what i mean delete the animate script instantly before any animations can start. This pose:

image

2 Likes

is your script playing animations in a loop; while true do?

1 Like

for the default animate script in the character, how would i reset it to that position

To reset the rig to it’s default position when the animation ends, you need to make sure the animation isn’t looped. Or like I said, using the Animation:Stop() will completely cancel out your currently playing animation, weather it’s looped or not.

2 Likes

Do you mind sending the script so I can read it? To send it in script format, just type these before you type the script and after: ```

1 Like
   local player = game:GetService("Workspace"):FindFirstChild(player.Name)
   if player then
   	local humanoid = player:FindFirstChild("Humanoid")
   	if humanoid then
   		local animator = humanoid:FindFirstChild("Animator")
   		if animator then
   			local animations = animator:GetPlayingAnimationTracks()
   			for i = 1, #animations do
   				
   				animations[i]:Stop()
   			end
   			
   		end
   		
   		
   	end
   end
end

the top line didnt come through, it was just a function definition

I see your issue. :GetPlayingAnimationTracks() is no longer supported by Roblox. (basically doesn’t exist anymore).

You could try:

local animations = animator:GetChildren()
for _, v, in pairs(animations) do
        v:Stop()
end

it stops the animations, but does not reset to the position with no animation applied

I’m not sure what you mean. send me a picture of your character when the animation stops.

i figured it out , i need to adjust speed to math.huge so it ends up with no animations at all

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.