VectorForce only applies the force when jumping?

I am trying to force the player to the direction of the mouse. Everything works perfectly fine other then the fact that it only applies the force when I’m in the air. Here’s a clip:


and here is the script:

        local char = plr.Character or plr.CharacterAdded:Wait()
		local humRP = char:WaitForChild("HumanoidRootPart")
		local vectorForce = Instance.new("VectorForce")
		local a1 = Instance.new("Attachment",humRP)
		local dif = humRP.Position - mouse.Hit.Position
		local direction = Vector3.new(dif.X, 0, dif.Z)
		
		vectorForce.ApplyAtCenterOfMass = true
		vectorForce.RelativeTo = Enum.ActuatorRelativeTo.World
		vectorForce.Force = direction.Unit * -force
		vectorForce.Attachment0 = a1
		vectorForce.Parent = humRP
		game.Debris:AddItem(vectorForce,forceTime)
		game.Debris:AddItem(a1,forceTime)

any help would be great! (forcetime is 0)

1 Like

I would recommend doing body vel or tween for this.

if you really want to do it with vector force, try enabling CustomPhysicsProperties for the character’s feet and set its friction to 0

body velocity is deprecated and tweening wouldnt have physics

This is because the way humanoids work they grip onto the floor when standing on the floor and they ignore physics

The only way to stop the humanoid from gripping onto the floor is to change its state

character.Humanoid:ChangeState(enum.HumanoidStateType.Physics)

This will stop the humanoid from gripping the floor and will allow your force to work

But if you only want to make the player walk in the direction of the mouse then you could use

https://developer.roblox.com/en-us/api-reference/function/Humanoid/MoveTo

1 Like

Yes,But many games still use it.

my character flops onto the floor but I’m going to make it ragdoll so this works perfectly, thankyou.

that’s good but lets say you wanted to keep the character upright you could use something like

https://developer.roblox.com/en-us/api-reference/class/AlignOrientation

to stop the player from flopping over :wink: