I made a custom rig morph with a UI where you can do certain animations. The buttons play an animation when clicked. It plays the animation once without looping it. However, when I tested it, it didn't work. It basically combined the idle animation and the button's animation together, forming a weird, simple animation. I've tried making a thing where it stops and plays the idle animation, but didn't work. Here is the error that came out of the output and the main part of the script.
Error
Stop is not a valid member of Animation "Workspace.Office_Bucket.BaseAnimate.idle.Animation1"
Script
player = script.Parent.Parent.Parent.Parent.Parent.Parent.Character function onClicked() -- You can edit these functions to do a certain thing. if script.Parent.Parent.Parent:FindFirstChild("Action") ~= nil then --Don't edit this script.Parent.Parent.Parent.Action:Play() end local Animation = player.Humanoid:LoadAnimation(script.Emote) wait(0.1) player.BaseAnimate.idle.Animation1:Stop() wait(.1) Animation:Play() script.Disabled = true script.Parent.Visible = false wait(1) player.BaseAnimate.idle.Animation1:Play() wait(.1) Animation:Stop() script.Disabled = false script.Parent.Visible = true end
If anybody knows how to fix this, please tell me.
Hello, office! You used Animation:Stop()
correctly, but however. In line 8, it tries to stop the Animation (animation1)
itself, which isn't valid. Because you need to use LoadAnimation
, which you have done on line 6, which is why Animation
stops. But animation1 doesnt, because it isnt a loadanim animation.
Try combining all the scripts into one. This way, you can use LoadAnimation throughout different click functions, again, in one script. Example:
script.Parent.MouseButton1Click:Connect(function() print("Hello world!") end) script.Parent.ButtonPath.MouseButton1Click:Connect(function() print("Hello world!2") end) --and so on until every button is filled.
This makes it easier to identify each animation by number, and can use them in different functions. This way, you don't have to navigate in a script to a regular animation, but instead, identify them all by number with LoadAnimation (in click functions), and stop them when desired.
Tell me if this did or did not help!