I modeled a diamond mesh (shown below) and I want to make it spin using an animation when it is being held in a tool.
This is what I am trying to achieve: Classic Baseplate - Roblox Studio (gyazo.com)
However, when I play the game, the animation does not play.
I just used a free script, I’m not sure if there’s something wrong with it but there are no errors in the Output window.
Here is the script:
-- Credits > axent22
-- Insert inside the tool
local tool = script.Parent
local anim = Instance.new("Animation")
anim.Name = "IdleAnim"
anim.AnimationId = "rbxassetid://15848012120" -- Idle Animaton ID
local track
-- When Tool Equipped
tool.Equipped:Connect(function()
track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
track.Looped = true
track:Play()
end)
-- When Tool UnEqiopped
tool.Unequipped:Connect(function()
if track then
track:Stop()
end
end)
I was thinking that if it works properly in the animation window then it should work in the game. But I don’t know why it doesn’t.
If someone could help, it would be greatly appreciated!
If it’s a local script on the client I’m pretty sure it won’t show on the server.
The reason it runs in Studio is that all the gameplay is handled by your computer, not the server.
Could you just CFrame the diamond’s Orientation to spin while it’s equipped?
And use task.wait() instead of wait (it’s better, wait is deprecated)
Also you cant wait(.001). I think the minimum is something like .03 seconds (frame rate of the game) so just use task.wait().
This post shows the solution as using a Motor6D animation, which I already have shown to be working properly in the animation editor. Your other suggestions didn’t make the rotating script work either.
I couldn’t CFrame the handle earlier, so why would this work? Also, this is involving a part locking onto the camera’s point of view, which isn’t what I am trying to achieve.