How do I make a player levitate?

So I’m attempting to make this ability where the player ascends to a certain point and levitates, still being able to move but is ACTUALLY at that location, and what I noticed is when I used HipHeight, its just height so it ended up still making the player able to fall, are there any alternatives as to how I can do this?

image

3 Likes

You could use a BodyPosition to move the player into place, and just make sure it can’t produce force on the X and Z axises

2 Likes

If anyone needs a visual demonstration of the issue, here

1 Like

Alright, Ill try that out thanks!

1 Like

Wait, will the fact that its deprecated cause any issues?

1 Like

you could play around with linear velocity too

1 Like

It should work fine, but if it breaks in the future, you’ll have to switch to a different solution.

use hipheight with antigrav?

nice terraria font

AlignPosition | Documentation - Roblox Creator Hub should be the same as bodyposition

1 Like

If the OP doesn’t want the player to snap up when walking onto a higher platform, this won’t work as intended.

Remember: There’s a Simple Spell that is known as the Levitation Charm, and its Incantation is None other than “Wingardium Leviosa”.

3 Likes

I’ll try this due to how BodyPosition didnt work…

1 Like

The two times I’ve tried it with the following scripts seemed to output the same error…

image
image

image

If BodyPosition didn’t work, its possible that you:

  • Didn’t set P high enough
  • Set D to something large
  • Incorrectly set the Position
  • Didn’t set MaxForce.Y to something high enough

well BP just brought me to 0,0,0 instead

Can you show line 280 or at least the line numbers?

You have to set the position or else it defaults to 0,0,0 (Only the Y position is important as long as MaxForce’s X and Z are 0)

Updated the script and it works for the most part, only thing it doesnt let me do is move around with X and Z, and when I try to set the maxforce it just returns and error…
image

Mind showing the error it throws?

image
image