So i have been trying to make a door animation play when touched, i tried searching it up because i had no idea how to do it and all i could see were scripts on how to make the animation play for a humanoid instead of an object, but since i have to add code or my question will get deleted, i will add this:
local PlayerAnimationFeedback = {}
local FeedbackAnimationTrack
local ANIMATION_FADE = 0.3
local ANIMATION_ID = "rbxassetid://"
function PlayerAnimationFeedback:LoadAnimation(humanoid)
local FeedbackAnimation = Instance.new("Animation")
FeedbackAnimation.AnimationId = ANIMATION_ID
FeedbackAnimationTrack = humanoid:LoadAnimation(FeedbackAnimation)
FeedbackAnimationTrack.Priority = Enum.AnimationPriority.Action
FeedbackAnimation.Looped = true
end
function PlayerAnimationFeedback:PlayAnimation()
FeedbackAnimationTrack:Play(ANIMATION_FADE)
wait(FeedbackAnimationTrack.Length)
end
return PlayerAnimationFeedback

1 comment
You could technically use a hinge constraint for it but it would be very inefficient