How do i fix linear velocity launching player too fast when moving the camera around?

i made a teleport dash system which uses linear velocity to move the player. it works fine when you do it the normal way, like the first 2 dashes shown in the video, but when you move your camera around you go way way faster. is there any way to fix this? heres the video of the problem and the code

local att = Instance.new("Attachment", hrp)
		att.Axis = Vector3.new(-90,0,0)
		local vel = Instance.new("LinearVelocity")
		vel.VelocityConstraintMode = Enum.VelocityConstraintMode.Line
		vel.LineDirection = hrp.CFrame.RightVector * -1
		vel.LineVelocity = 125
		vel.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
		vel.Attachment0 = att
		vel.MaxForce = math.huge
		vel.Parent = hrp
local track = TS:Create(vel, TweenInfo.new(.6, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out, 0, false, .2), {LineVelocity = 0})
		track:Play()
		track.Completed:Connect(function()
			track:Destroy()
			att:Destroy()
			vel:Destroy()
			
		end)

this is a local script, forgot to say

Make the maxforce like 35000 instead of math.huge

set to 19500 and seems to be a lot better now

1 Like

actually it needs more tweaking but the idea still is the right one

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