BodyVelocity not moving character?

Hey Developers,

I’m attempting to cause the character to rise slowly off the ground and into the air.
I want to achieve this through use of the BodyVelocity shown in the attached image.

The vertical MaxForce = 1.1 * total mass of character * workspace.Gravity.

As pictured, the character only begins to rise after losing contact with the ground, either through jumping or walking off an edge. See attached GIF for an example.

With increased force, the character will rise off the ground, but since this amount should be enough, I want to know why it isn’t. The force applied is greater than the force of gravity, so why isn’t the player rising off the ground?

unknown
GIF

5 Likes

Try setting P to 0. The BodyVelocity might not be reaching the MaxForce you set because of its built in damping through the P property. By setting it to 0 you are disabling damping so it should reach the max force required to get to that velocity less than or equal to the max force specified.

1 Like

When I set P to 0, the only difference was that there was no perceivable drop after stepping off of the map. No spontaneous ascent began while standing on the ground.

1 Like

Well yeah the resultant force is quite low relative to the mass so it is not going to be able to accelerate very quickly

Setting the Humanoid’s PlatformStand to true will allow the character to slowly move up. I’m pretty sure the sticking to the ground thing is something to do with the roblox engine. If you don’t like the player losing the ability to control their character, set PlatformStand to false when the character leaves the ground.

3 Likes

From the background and the issue, I’m assuming you just want the player to rise up when the event is called? If so, couldn’t you just set the velocity of the humanoidrootpart to 100 or 50 going up to make the player move up so the bodyvelocity works? Or you can just CFrame the character up a little if you wanted to give it a boost and make it float.

I just make it so the character jumps by getting their Humanoid and doing:
Humanoid.Jump = true
After setting the BodyVelocity

Works every time

Also, you could also just move the HumanoidRootPart using Cframe like @3rdhoan123 said.

2 Likes

I’m not sure if this is what you want, but what I do is:

  1. Set the Desired RootPart’s Network Owner to nil inside of a Server script
  2. Create a Body Velocity with a MaxForce of Vector3.new(math.huge, math.huge, math.huge)
  3. Set my Velocity to a given Vector3 constructor value

And that’s all there is to it, once I have deleted my Velocity I set the RootPart’s Network Owner back to the Player.
I don’t change the P Value, because I don’t need to. If I am creating a Knockback with my Combat Systems I just give it a LookVector or UpVector value of the given Target Root Part and multiply that by a certain number, which you can do with the gravity of the workspace probably and adjust some things there.

So I guess you could do although I’m not sure if this is right:
BV.Velocity = RootPart.CFrame.UpVector * Mass * workspace.Gravity / Number_Here

I do this method with my current Advanced Combat System as shown here:

Sorry for the unsmooth and slow quality of the gif, my internet upload speed isn’t that great.

I hope this is what you’re looking for with a Body Velocity though.

10 Likes

Thanks for all the suggestions. I’ll try them out when I get a chance and post what worked.

That makes sense, because it behaves really oddly. If I increase the strength of the BodyVelocity gradually from 1.1 to 1.5, nothing happens, but if I set it straight to 1.5, the character takes right off.

1 Like

I tried using CFrame at first, but I had to raise the character a full stud off the ground for the floor stick to stop, which got a bit awkward. I’d thought about using Jump or RootPart.Velocity, but the visual effect is kind of strange.

Got it working using PlatformStand, it gave the best results. Thank you!

You can check out the place w/ this functionality here :point_down:
We’ll be adding more to it.

1 Like