Unable to change AlignOrientation/AlignPosition mode

Currently, as of 16th April 2024 at 12:30 PM IST, I’m unable to change the mode of AlignOrientation and AlignPosition using Enum inside of a script.

Trying to change it inside a script gives an error ``Unable to assign property mode. EnumItem of type mode expected got an EnumItem of type OrientationAlignmentMode.


Reproduction Steps:

  1. Add an AlignPosition or AlignOrientation inside any BasePart in workspace
  2. Add a script and try to change the Attachment mode using the attachment mode.
    image
  3. Set it using OrientationAlignmentMode as shown in the Creator Hub Article.

You’ll get the error, the same error is repeated even if PositionAlignmentMode is used


Expected Behavior:*
I should be able to change the mode without any errors.


Device Specifications:
Intel Core i5 11th Gen
8GB Ram
512 GB SSD
Windows 11 Home
Language: EN-US
Nvidia mx450 2GB

Hi Woodx,
Two of us from the physics team here have tried to reproduce this and we can’t. Could you attach your script so we can be sure we’re reproducing your exact results?

Thanks

1 Like

Sure. Here is the script:

local newPart = Instance.new("Part",workspace)
local attachment = Instance.new("Attachment",newPart)
local newAlignposition = Instance.new("AlignPosition",attachment)
-- newAlignposition.Mode = "OneAttachment" -- this won't error, but enum is expected to work
newAlignposition.Mode = Enum.OrientationAlignmentMode.OneAttachment -- this is not working and will error

I see the issue.
We have two alignment mode enums, one for position and one for orientation.

--- This won't work
newAlignposition.Mode = Enum.OrientationAlignmentMode.OneAttachment 
---This is the correct enum for AlignPosition 
newAlignposition.Mode = Enum.PositionAlignmentMode.OneAttachment

You should be all set now.