How to make attachment straight

how can i keep an attachment i make in a part stay straight? (relative to the part)
ive been calculating, removing inverse rotations blabla i think 10 different methods all of them are never perfectly straight or work.

att.WorldPosition = cf.Position
att.CFrame = att.CFrame * CFrame.Angles(180,0,0)

(yes, worldCframe does the same thing)

i remove the rotation, then put my desired rotation and its still off by like 10 degrees for some reason bruh ( keep in mind when i edit in game and set the rotation to that its straight)

what i want: ____________________________ what i get:

1 Like

Have you tried setting the world cframe of the attachment to the part’s cframe?
attachment.WorldCFrame = part.CFrame

1 Like

No, because i only need it to be straight, but the actual vector position is always different, its only parented to the part

I’m sorry I’m stuggling to understand what you are trying to do, just tried in studio and is straight to the part, are you wanting to offset from here or something?
I did use math.rad I’m guessing you forgot to add when making the post

local part = workspace.Part
local attach = Instance.new("Attachment",part)

attach.WorldPosition = part.Position
attach.WorldCFrame = part.CFrame
attach.WorldCFrame *= CFrame.Angles(math.rad(180),0,0)

From the model tab in the studio there is an edit pivot tool. Not sure if this will help …

oh my days i forgot the math.rad i was so tired yesterday thanks for pointing that out

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.