Hello.
I’m trying to make a trick or treating system for one of my game updates. (Pre preparing) I’ve got it all down, now I just need to make the door bell. When I click the door bell. I want a animation to play on one of the models (DoorBellSysten, models inside: doorbell, door) Can anyone help me?
So you would actually get the model's Animation Controller Instance (whether that be an AnimationController or Humanoid).
local model = workspace.Model; -- Change this to the model to play animation on local animID = "AnimationID Here"; local animation = game.ReplicatedStorage.Animation or Instance.new("Animation"); animation.Parent = game.ReplicatedStorage; animation.AnimationId = animID; local player = model:FindFirstChildOfClass("Humanoid") or model:FindFirstChildOfClass("AnimationController"); local animationPlayer = player:LoadAnimation(animation); -- To play, just do animationPlayer:Play();