I've made all the animations I need for my game. I just have to put a script in the block that I need to touch, then it will play the animation. I never figured that out. I know that this isn't a request site, but this is important if I want to finish my game. Do any of you know how this is done.
Well, this is actually relatively simple to do.
All you'd need to do is:
local Part = workspace.Part -- define the part local Animation = Part.Animation -- define animation local Players = game:GetService('Players') -- Services function onTouched(otherPart) local Humanoid = otherPart.Parent:FindFirstChildOfClass('Humanoid') -- you'll need this if Humanoid then local Humanoid = otherPart.Parent.Humanoid for _,track in pairs(Humanoid:GetPlayingAnimationTracks()) do if track.Animation.Name ~= Animation.Name then -- make sure isnt already playing local newTrack = Humanoid:LoadAnimation(Animation) newTrack:Play() end -- check animation name end end -- loop end end -- check humanoid end -- function end Part.Touched:Connect(onTouched) -- connect to function
I probably made it a lot more complicated than I need to but I'm hoping the GetPlayingAnimationTracks will act as a debounce.