After adding an attachment to the Torso of a character, the orientation of the attachment is completely incorrect.
The code that does this looks like this:
local BackAttachment = Instance.new("Attachment")
BackAttachment.Parent = Character.Torso
BackAttachment.CFrame = CFrame.new(0.213, 0.548, 1.356)
* CFrame.Angles(math.rad(-65), math.rad(160), math.rad(120))
BackAttachment.Name = "TorsoFloatForceAtt"
(Attachment CFrame as seen in properties in-game)
Note how the position property is perfectly fine.
It’s run on CharacterAdded, though I don’t suspect that’s the issue. The attachment is not touched at all afterwards.
I tried adding task.wait(1)
to see if it was some kind of repositioning error that happens when the character is moved to where it’s supposed to be - it isn’t, the bug still happens.
Printing BackAttachment.CFrame:ToOrientation()
leads it to print only the X rotation in rads, which in degrees is 58.39
, which is what showed in the Properties tab.
The code at this point looks like this:
task.wait(1)
local BackAttachment = Instance.new("Attachment")
BackAttachment.Parent = Character.Torso
BackAttachment.CFrame = CFrame.new(0.213, 0.548, 1.356)
* CFrame.Angles(math.rad(-65), math.rad(160), math.rad(120))
print(`BackAttachment CFrame: {BackAttachment.CFrame}, Orientation: {BackAttachment.CFrame:ToOrientation()}`)
BackAttachment.Name = "TorsoFloatForceAtt"
Is there any kind of workaround for this, or could this be a bug?