m_acch
(Mach)
#1
script.Parent.Parent.ViewportFrame.MouseEnter:Connect(function()
local humanoid = script.Parent.dummy:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://14224225681"
local track = animator:LoadAnimation(anim)
track.Looped = true
track:Play()
end)
it just dosent work on the viewport dummy
Try placing your model Inside a WorldModel
1 Like
m_acch
(Mach)
#3
I placed the dummy in a world model, didnt work
It should look like this your structure:
→ ViewportFrame
| → WorldModel
| | → Dummy
Is it like that? Is the script inside the Dummy? If yes, where inside it?
Try this script, make sure WorldModel is named WorldModel
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://14224225681"
script.Parent.Parent.ViewportFrame.MouseEnter:Connect(function()
local humanoid = script.Parent.WorldModel.dummy:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")
local track = animator:LoadAnimation(anim)
track.Looped = true
track:Play()
end)
m_acch
(Mach)
#7
It is named worldmodel, I tried this version of the script and it just doesn’t work
Can you send me the console output? Also just to be sure, LocalScript is parent of ViewportFrame?
m_acch
(Mach)
#9
none that is related to the directory or the script
Put it outside of WorldModel.
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://14224225681"
script.Parent.MouseEnter:Connect(function()
local humanoid = script.Parent.WorldModel.dummy:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")
local track = animator:LoadAnimation(anim)
track.Looped = true
track:Play()
end)
m_acch
(Mach)
#12
What do I put outside the worldmodel
You put the LocalScript outside the WorldModel, parent it to the ViewportFrame.
m_acch
(Mach)
#14
its parented to the viewport frame
Have you already changed the script to this one?
m_acch
(Mach)
#16
I have infact changed to that script
Are you sure there are 0 errors on the output? If there’s any take a screenshot and paste here.
m_acch
(Mach)
#18
ill try this on a baseplate and see if there would be a output
Simply, your humanoid does not have an “Animator” inside of it.
local animator = humanoid:FindFirstChildOfClass("Animator")
Is returning nil.
1 Like