I’m trying to create a drag part system similar to lumber tycoon 2, and I’m using OrientationAlign object so the part keeps the same orientation.
But I’ve realized that if I set the orientation of the part that holds the Attachment1 of OrientationAlign to something like
CFrame.Angles(X,Y,0) the OrientationAlign will try to keep the part at 0 orientation on Z axis.
I don’t know how to work around this, any help will be appreciated.
Thanks in advance.
Try using bodygyro instead. New bodymovers lack features.
bodygyros are deprecated same as bodyposition
Still work tho. What else can you use when ROBLOX refuses to add a proper alternative?
It won’t be supported tho.
And also i have made a perfect system using the new align objects.
Should i just move to bodygyro?
If align objects don’t have the functionality you require, you can either program the forces yourself or use older bodymovers
I see, how would I do that with my case?:
Aori.CFrame = CFrame.Angles(RotX,RotY,0)
i don’t get how does the negating a cframe work
local GivenCFrame: CFrame = -- cframe goes here
local GivenPosition: Vector3 = -- put the position of the cframe here
local _, y = GivenCFrame:ToOrientation()
alignOrientation.CFrame = CFrame.new() * CFrame.Angles(0, y, 0)
That kinda works, but in my case, im trying to make part dragging system and whenever a part is rotated and put down, when i pick it up again, it doesn’t retain it’s position but it goes to default position which is 0,0,0…
Okay I fixed it. I have changed it to this:
Aori.Orientation = Vector3.new(x+RotX,y+RotY,z)
the Aori is the Attachment set for AlignOrientation object.
the x,y,z is a reference of the starter position of target part.
local x,y,z = Target.Orientation.X,Target.Orientation.Y,Target.Orientation.Z
And RotX, RotY are the rotation values changed by clicking R key or T key.