Issue with AlignPosition

Hello there Roblox Programmers, I faced an issue when trying to work with AlignPosition.

We all remember those days when BodyPosition was an actual thing, and one of the properties of this instance was MaxForce.

Taken from BodyPosition | Roblox Creator Documentation

But since this has been deprecated, we have to now use “AlignPosition”.

It was all good until, I wanted to change the MaxForce property of the alignposition.
But unfortunately,

Taken from AlignPosition | Roblox Creator Documentation

MaxForce here is a Number and not a Vector3. So, my question is simple:

How do I make an AlignPosition ignore the x and the z axis, and work only on the y axis? I do not want it to change the position on x and z axis.

You could set AlignmentMode to OneAttachment, then have a script that updates just the y position of the AlignPosition Position to the other part

What are you trying to move?
There may be other Constraints and Movers that might work for your application. Mover Constraints | Roblox Creator Documentation

Here’s the BodyMovers Tutorial place. I can’t seem to find it in the Guides section anymore, but I did save a copy to my computer.
New Body Movers Example.rbxl (35.0 KB)

Could you give the script which updates just the y position of the AlignPosition.Position to the other part?

I’m actually working with the HumanoidRootPart. I need a BodyPosition like system where I can set it to work only on the Y axis.

You can assume that I’m trying to make a system which makes a character float. The player can
move the character as usual on the x and z axis, but the character is floating in mid air, without affecting
any other mechanics.

Ah, I’m not sure if the Humanoid physics creates issues with AlignPosition.
BodyPosition is still a thing though and you can use it. It’s deprecated, but they’ll keep it around so older games don’t break. That means AlignPosition should take care of the situation you have.

There are a lot of examples in the 2nd link I posted. You can see the settings for having AlignPosition ‘float’ a part in one location, or float it at a Y position but be allowed to push it around. Take a look, it’s kinda fun to see how the new Movers can be used.

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