Help with LinearVelocity

How can I prevent that from happening?

Oh, yeah you’re right…

1 Like

I have tried making the character density to 100, and friction to max.

Instead of using LinearVelocity to move the character, focus on using the already existing movement system paired with whatever elements you want to include.

I’m assuming you want to use the arms as a way to leverage yourself from one place to another. Try different combinations of methods and properties of both the character model and the functions of the arms, however you’re scripting them.

BodyVelocity will probably just distract you from what is already possible through the default movement methods. :slightly_frowning_face:

1 Like

I can’t because the Freefall state would ruin it. Freefall makes the character slide off.

(I’m setting LinearVelocity to the MoveDirection)

linearVelocity.LineDirection = humanoid.MoveDirection
1 Like

What about disabling freefall altogether?

By the way,
Did you make sure to remove the velocity being applied to the character when they are done moving?

I just set LinearVelocity to false when the player stops moving.

if humanoid.FloorMaterial == Enum.Material.Air then
				linearVelocity.LineDirection = Vector3.new(humanoid.MoveDirection.X,0,humanoid.MoveDirection.Z)
			else
				linearVelocity.LineDirection = humanoid.MoveDirection
			end

			if humanoid.MoveDirection == Vector3.new(0,0,0) then
				linearVelocity.LineVelocity = 0
				linearVelocity.LineDirection = Vector3.new(0,0,0)
				linearVelocity.Enabled = false
			else
				linearVelocity.LineVelocity = humanoid.WalkSpeed
				linearVelocity.Enabled = true
			end

(This code is in a loop)

What do you mean by disabling freefall altogether?

Have you tried applying a force to the Y axis as well?

Also, I mean completely disabling freefall like you posted here.

Yes. I have not tried applying force to the Y axis.

Give both ideas a shot, and see where you land. If you haven’t tried something that might work, there’s no harm in an attempt. :smile:

What am I supposed to do with the Y axis?

if humanoid.FloorMaterial == Enum.Material.Air then
				linearVelocity.LineDirection = Vector3.new(humanoid.MoveDirection.X,0,humanoid.MoveDirection.Z)
			else
				linearVelocity.LineDirection = humanoid.MoveDirection
			end

Oh wait, I figured it out! The attachment was the problem.


kinda works
I moved the attachment infront of the player.

Set LinearVelocity.LineDirection to Vector3.new(humanoid.MoveDirection.X,Humanoid.MoveDirection.Y,humanoid.MoveDirection.Z)

Also, I’m glad to see you got it working better. Keep working at it and eventually you’ll be able to perfect it!

Jump is disabled so MoveDirection.Y would be 0.

1 Like

I actually fixed it! (just removed a couple lines and it worked!)

if humanoid.FloorMaterial == Enum.Material.Air then
				linearVelocity.LineDirection = humanoid.MoveDirection
				linearVelocity.LineVelocity = humanoid.WalkSpeed
				linearVelocity.Enabled = true
			else
				linearVelocity.LineDirection = Vector3.new(0,0,0)
				linearVelocity.LineVelocity = 0
				linearVelocity.Enabled = false
			end
			
			if humanoid.MoveDirection == Vector3.new(0,0,0) then
				linearVelocity.LineDirection = Vector3.new(0,0,0)
				linearVelocity.LineVelocity = 0
				linearVelocity.Enabled = false
			end

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