With AlignOrientation it appears you can only set the MaxTorque for all axes. I haven’t worked with AlignOrientation on anything other than AlignType.AllAxes so I’m not entirely sure how the other AlignTypes work. Does anyone have a better idea of how I could create multiple AlignOrientations and use other AlignType modes in order to create distinct MaxTorque values?
For reference, I want the X/Z torque to go there immediately (Responsiveness 200 / MaxTorque huge) and the Y torque to go there slowly over time (lower Responsiveness / MaxTorque)
Try creating multiple AlignOrientation instances and configure each one to handle a specific axis or set of axes. This way, you can set distinct MaxTorque and Responsiveness values for each axis.
Note that I haven’t exactly tried this, but I’m assuming using separate AlignOrientation instances for different axes, should let you finely control the torque and responsiveness for each axis individually.
-- Create AlignOrientation for X/Z axes
local alignOrientationXZ = Instance.new("AlignOrientation")
alignOrientationXZ.Name = "AlignOrientationXZ"
alignOrientationXZ.AlignType = Enum.AlignType.OneAttachment
alignOrientationXZ.MaxTorque = Vector3.new(1000000, 0, 1000000) -- High torque for X/Z
alignOrientationXZ.Responsiveness = 200 -- Immediate alignment
alignOrientationXZ.Parent = somePart
-- Create AlignOrientation for Y axis
local alignOrientationY = Instance.new("AlignOrientation")
alignOrientationY.Name = "AlignOrientationY"
alignOrientationY.AlignType = Enum.AlignType.OneAttachment
alignOrientationY.MaxTorque = Vector3.new(0, 1000, 0) -- Lower torque for Y
alignOrientationY.Responsiveness = 10 -- Slower alignment
alignOrientationY.Parent = somePart
-- Attachments
local attachment = Instance.new("Attachment")
attachment.Parent = somePart
alignOrientationXZ.Attachment0 = attachment
alignOrientationY.Attachment0 = attachment
I’ve been trying things with PrimaryAxis and setting it to the axis I want to control for each AlignOrientation instance, but I can’t seem to find any good documentation on it in the DevHub
I think what’s confusing me is how the PrimaryAxis combines with Attachment1.
The devhub says: PrimaryAxisParallel Aligns the primary axis to be parallel to the axis given by Constraint.Attachment1.
I haven’t really been getting anywhere with one attachment, so maybe this means I need multiple Attachments with multiple AlignOrientations, with each Attachment having a different Axis, and each AlignOrientation having a different PrimaryAxis? It seems like using the same constraint and setting different PrimaryAxis vectors leads to competition amongst the AlignOrientations to align every single axis to face the PrimaryAxis.
And an AlignOrientation with these will allow for Rigidity in the XZ plane, and variations in the Y axis.
Edit - the AlignOrientation is of mode PrimaryAxisParallel
I then just threw in a second AlignOrientation with AllAxes (since the first 2 have rigidity) and set the MaxTorque value appropriately.