How do I set a LookAt position for Align Orientation?

I’ve been making a game involving missiles, and none of the things like CFrame.LookAt have been working, so I instead decided to move to constraints.

I’ve been trying to set the LookAt position for AlignOrientation but it doesn’t change according to the explorer.

This is the code I have so far relating to AlignOrientation

lookPart.AlignOrientation.LookAtPosition = target.Position
lookPart.AlignOrientation.Enabled = true

It just doesn’t change anything. I couldn’t find something similar on other posts as well.

1 Like

Have you set the AlignType of your AlignOrientation object to Enum.AlignType.PrimaryAxisLookAt before assigning the LookAtPosition property?

Also, ensure your alignment mode is set to OneAttachment.

I have preset both options inside the explorer before running the game.

When you set the property in your script, it doesn’t update in the properties panel?

If so, are you sure your script is reaching the point where it sets the property (LookAtPosition)?

I just realized that the script does not reach that point. I’m going to attempt to fix it and reply to you if it works.

1 Like

So the problem is fixed as in the LookAt position is set, but now the missile does not actually look at the target. However, that is a separate problem and I might be creating a new topic for that. Thank you for helping me!

1 Like

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