Hey guys, not sure if this is the right section to post but I did it since it involves scripting and animation but I have already the animation done so, it’s the scripting part that may be the wrong.
So, I made an animation using Moon Animator 2 for an ability (a tool named “Ability1”) and I wanted that the accessory on the user moves but it doesn’t because Roblox doesn’t handle CFrames in their animations being published.
This is what happened with my older animation with the part being the child of Head and I used the animation ID for it (this is before i made a new animation with CFrame on it):
External MediaThe script I had used it for the video above, the names I used are the same as I had used for the animation, same for the accessory. I don’t know if it’s the hierarchy cusing this
local tool = script.Parent
local humanoid = nil
local animation = nil
local blindfold = nil
local blindfoldTemplate = game.ReplicatedStorage.blindfold
local animationId = "rbxassetid://14246941765"
local function onActivated()
local character = humanoid.Parent
local track = humanoid:LoadAnimation(animation)
track:Play()
repeat wait() until track.IsPlaying == false
if blindfold then
-- remove blindfold
blindfold:Destroy()
blindfold = nil
else
-- put on blindfold
blindfold = blindfoldTemplate:Clone()
blindfold.Parent = character
blindfold.Handle.CFrame = character.Head.CFrame * CFrame.Angles(math.rad(180), math.rad(225), 0) * CFrame.new(0, -0.2, 0)
humanoid:AddAccessory(blindfold)
-- create a WeldConstraint between the blindfold and the character's head
local weld = Instance.new("WeldConstraint")
weld.Part0 = blindfold.Handle
weld.Part1 = character.Head
weld.Parent = blindfold.Handle
end
end
local function onEquipped()
humanoid = tool.Parent:FindFirstChildWhichIsA("Humanoid")
animation = Instance.new("Animation")
animation.AnimationId = animationId
animation.Parent = humanoid
end
tool.Activated:Connect(onActivated)
tool.Equipped:Connect(onEquipped)
Here is the hierarchy if you need it:
The CFrame one is the BlindFold u see over the Head and the accessory is inside the Head that I had used for the previous video
So I made a second animation with CFrame on it and I don’t know how to make it work on the ability since the other animations I could save and publish on Roblox but these ones I couldn’t because it has CFrame on it and it is stored under ServerStorage > MoonAnimator2Saves | classname: “folder” >
Also, I am not sure if it’s the animation that I did wrong because when I was animating and I tried to replicate the accessory’s handle position, I saw this
This is the CFrame’s values when i was animating, it’s on the head of the rig
And this one’s from the accessory that I have joined in place with the Head
If I put the cframe’s values to 0 it goes to the origin of the baseplat, I don’t know if this is normal or I should make some math in the script when I make the animation work
External MediaI don’t know If I did something wrong when I pressed the Add part when adding the blindfold or i may have forgot something related with position, angle?
I watched videos on Youtube but I couldn’t find the problem I was having, nor on the DevoForums nor I could find when googling and I even asked ChatGPT and even he can’t help me. So that’s why I made this thread. This is all the hypothesis I could think of or might help debug it, I’m not a scripter, so yeah.
I’d appreciate your help.
Edit: for some reason the videos I posted with the streamable link are only playable downloaded? And one of my image is blank, you have to click on it to see it
Edit 2: you can see in the image with the hierarchy it’s called “BlindFold” this is when I scrapped with the idea with the accessory not working with animation so I was shifting with CFraming, I had changed the name because it’s originally what I was using for it, I don’t know how can I impliment it in the script.
edit 3: updated videos link