[SOLVED] How to prevent rotation on ALL axes using AlignOrientation?

I’m trying to figure out how these Constraint Movers work. I have no problem understanding AlignPosition and LineVelocity, but AlignOrientation is a problem for me.

Basically, I have Humanoid-less NPCs, which should move around the map in a certain direction.

I need these NPCs to keep the same Y position and only change the X and Z axes. For that I have used AlignPosition and works with no problems.

The problem begins when I try to use AlignOrientation. I need to prevent the NPC from freely rotating on ALL axes, but let a Script set it’s Y orientation when necessary.

And lastly apply LinearVelocity in a specific direction - no problems with that.

How do I setup the AlignOrientation, so it works as I expect it to?

Have you checked out the Roblox documentation?
Classes > AlignOrientation AlignOrientation | Documentation - Roblox Creator Hub
Constraints > AlignOrientation AlignOrientation | Documentation - Roblox Creator Hub

They are a little tricky trying to figure out the first couple of times you use them, since there are many options in the Properties.

It’s sometimes difficult since the documents don’t generally give you an example set up the exact way you want it to perform. You can generally experiment with the settings until you find out what works for you.

1 Like

I had and still have a hard time figuring out how to prevent rotation on ALL axes. I was able to prevent rotation on 2 axes, but not on all 3 of them.

That’s why I’m here asking for help.

If anyone is wondering, here is my solution:

Properties

When changing the NPC’s orientation, I have to set it as a property of AlignOrientation, not the parented part!

2 Likes