LinearVelocity Issues with ground

I’m working on basic M1 combat right now. I want the player to move forward with each punch. I started off with placing a Attachment and LinearVelocity into the HumanoidRootPart. Here’s my issue: When jumping the player goes further using it, but on the ground it’s super slow and short.

local Lv = Instance.new("LinearVelocity",humrp)
	local A0 = Instance.new("Attachment",humrp) 
	A0.Orientation = Vector3.new(0,90,0)
	Lv.RelativeTo = "Attachment0"
	Lv.MaxForce = math.huge
	Lv.Attachment0 = A0
	Lv.VectorVelocity = Vector3.new(100,0,0)
	game.Debris:AddItem(Lv, 0.05)
	game.Debris:AddItem(A0, 0.05)

LV.RelativeTo should be Enum.ActuatorRelativeTo.Attachment0. The property is an Enum and not a string.

The character seems to ‘glue’ to the ground when standing up. If you turn PlatformStand on, it should go as fast as in the air, though scraping it’s rear end on the floor all the way.

Thus, i would use a BodyVelocity rather than a LinearVelocity, and if you don’t want it to fling your character when hitting a wall, i recommend setting P to huge and MaxForce to around 10k-20k (considering that the HumanoidRootPart isn’t massless). Despite being deprecated, it is very simple to use.

1 Like

A bunch of people told me not to use BodyVelocity because it’s deprecated
Edit: I’ll just use it anyways and see if it works for me

I changed that line to Enum.ActuatorRelativeTo.Attachment0 but its still the same problem

I doubt you’ll find the answer in linearvelocity. I’ve used it myself, and it was quite the headache. BodyVelocity will move the character instantly, and does not require attachments. Note that it does need you to insert the exact position to go, in which case you can do

BV.Velocity = HumanoidRootPart.CFrame.LookVector * PunchVelocity

which isn’t that big of a problem.

1 Like

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