Accessory sheninegans

I’m trying to make tail type accessories (not Enum.AccessoryType) be animatable. How do I move accessory’s SpecialMesh offset so the accessory’s Handle is located at the waist, while the tail is staying in the same position as it was before the script (not counting it being animated)?

Here’s the code I have for now:

local Motor = Instance.new("Motor6D")
Tailiwi.Parent = Character --Tailiwi is an Accessory's Handle
Tailiwi.Name = "Tail"
Motor.Part0 = Torso
Motor.Part1 = Tailiwi
Tailiwi:FindFirstChildOfClass("SpecialMesh").Offset -= (Tailiwi:FindFirstChild("WaistBackAttachment") or Tailiwi:FindFirstChild("BodyBackAttachment")).Position
Motor.C0 = (Tailiwi:FindFirstChild("WaistBackAttachment") or Tailiwi:FindFirstChild("BodyBackAttachment")).CFrame
Motor.Parent = Torso

This script does not put the tail’s position properly.
image

1 Like

if you want to customize the position of where the tail is located (or rotated) then you need to multiply it with another CFrame. example:

Motor.C0 = Attachment.CFrame

to change the rotation, you would do something like:

Motor.C0 = Attachment.CFrame * CFrame.Angles(0, math.rad(90), 0)

to change the position, you would do:

Motor.C0 = Attachment.CFrame * CFrame.new(0, -1, 0)

so just customize the values until you get something that works. also, remember that doing this will make it so that the added values will always be relative to the Attachment’s CFrame. basically, if the attachment’s back-side orientation is facing a little off to the side, doing something like this:

Motor.C0 = Attachment.CFrame * CFrame.new(0, -5, 0)

will make it go down 5 studs relative to the Attachment, not relative to the world. I get that my explanation is horrible, so if you have confusions then just ask for clarification

1 Like

So, if I will multiply Handle’s current CFrame by Accessory’s attachment point’s CFrame, it will move by attachment point’s CFrame?

not exactly. you will need to define the original CFrame that it will move along to. this is the same for adding a Position through Vector3, but instead you move it along the defined CFrame instead of along the world. for instance:

part.CFrame = part.CFrame

will make the part’s CFrame be equal to it’s CFrame, which basically will not do anything. however doing something like this:

part.CFrame = part.CFrame * CFrame.new(0, -5, 0)

will make it go down 5 studs. however, if the bottom face of the part is facing towards the right, then the part will go 5 studs to the right. just give it a try and it should be pretty quick to understand how it works.

1 Like

also, you cannot directly set Motor.C0.Position = (vector value blah blah) or Motor.C0.Orientation = (vector value), because it’s a value that isn’t supposed to be changed. you are required to do Motor.C0 = (cframe value)