Is there any tips that I can elevate the smoothness of this move shown?
Preview :
Preview I want to achieve :
Code :
llocal p1 = HumanoidRootPart.Position
local p2 = (HumanoidRootPart.CFrame *CFrame.new(0,50,-Stats.TravelRange * 0.5)).p
local p3 = (HumanoidRootPart.CFrame *CFrame.new(0,-3,-Stats.TravelRange)).p
local bodyVel = Instance.new("BodyVelocity", HumanoidRootPart)
bodyVel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
for t = 0, 1, 0.025 do
local pos = quadBezier(p1,p2,p3,t + 0.05)
local attachment = Instance.new("Attachment", workspace.Baseplate)
attachment.WorldPosition = pos
attachment.Visible = true
--TweenService:Create(HumanoidRootPart, TweenInfo.new(.05), {Position = pos}):Play()
bodyVel.Velocity = CFrame.new(HumanoidRootPart.Position, pos).LookVector * Stats.TravelVelocity
task.wait(Stats.TravelTick)
end
spawn(function()
repeat
wait()
local pos = quadBezier(p1,p2,p3,1)
bodyVel.Velocity = CFrame.new(HumanoidRootPart.Position, pos).LookVector * Stats.TravelVelocity
until not bodyVel
end)