Humanoid.MoveDirection for a VectorForce

Hi, I’m trying to make a slide script in which the player is pushed in whatever direction they’re moving when you press a button. I have everything set up but when I try to set the VectorForce.Force to Humanoid.MoveDirection, it doesn’t seem to work. I ran a test where I printed tostring(Humanoid.MoveDirection) and that printed a Vector3 showing my exact move direction, so I really have no idea what’s wrong with the VectorForce. Here’s my code:

local LP = game.Players.LocalPlayer
local Hum = LP.Character.Humanoid

local SlideForce = Instance.new("VectorForce")
				SlideForce.Name = "SlideForce"
				SlideForce.ApplyAtCenterOfMass = true
				SlideForce.Parent = LP.Character.PrimaryPart.RootRigAttachment
				SlideForce.Attachment0 = LP.Character.PrimaryPart.RootRigAttachment
				SlideForce.Force = Vector3.new(Hum.MoveDirection)
				SlideForce.Enabled = true

Thanks!

I highly doubt this’ll work, but try LP Character.PrimaryPart.LookVector instead of Hum.MoveDirection.

MoveDirection is already a vector3, you can’t vector3.new a vector or else it will end up as 0,0,0.

Moreover you might also need to add more force so multiplying by a number should work as well.

that wouldn’t account for strafing

Then did you try what @dthecoolest said to?

1 Like