LinearVelocity without Y axis

I’ve only found one post about this online, and it didn’t help at all. This is my code right now:

local LinearVelocity = Instance.new('LinearVelocity')
LinearVelocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Line
LinearVelocity.LineDirection = char.HumanoidRootPart.CFrame.LookVector * 20
LinearVelocity.PrimaryTangentAxis = Vector3.new(1, 0, 0)
LinearVelocity.SecondaryTangentAxis = Vector3.new(0, 0, 1)
LinearVelocity.Attachment0 = char.HumanoidRootPart.RootAttachment
LinearVelocity.Attachment1 = char.HumanoidRootPart.RootAttachment
LinearVelocity.MaxForce = math.huge
LinearVelocity.Parent = char.HumanoidRootPart

I have no idea how to do this. I know it’s possible, since I’ve done it before, but I don’t remember how I did it. Any ideas??

Neeevermind.

local vel = Instance.new("LinearVelocity")
vel.RelativeTo = Enum.ActuatorRelativeTo.World
vel.VelocityConstraintMode = Enum.VelocityConstraintMode.Plane
local look = char.HumanoidRootPart.CFrame.LookVector
vel.PlaneVelocity = Vector2.new(look.X,look.Z) * _settings.Velocities.SwingVelocity
vel.PrimaryTangentAxis = Vector3.new(1,0,0)
vel.SecondaryTangentAxis = Vector3.new(0,0,1)
vel.Attachment0 = char.HumanoidRootPart.RootAttachment
vel.Parent = char
vel.MaxForce = math.huge
5 Likes

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