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.
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:
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
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.
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)