Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make moving humanoid BodyVelocity smoother?

Asked by
Neon_N 104
5 years ago

The command below is what I am using to move player forward when it is activated. But when you use it on the groud the default walking animation plays and ruins it. Please tell me how to improve this.

local ReplicatedStorage = game:WaitForChild("ReplicatedStorage")
local RemoteStore = ReplicatedStorage:WaitForChild("RemoteEvents")
local Remote = RemoteStore:WaitForChild("ForwardDashEvent")

Remote.OnServerEvent:connect(function(player)

    local Animation = Instance.new("Animation")
    Animation.AnimationId = 'rbxassetid://2164442959'
    local LoadAnimation = player.Character.Humanoid:LoadAnimation(Animation)
    LoadAnimation:Play()

    -- Move Player --
    local position = Instance.new("BodyVelocity",player.Character.HumanoidRootPart)
    position.MaxForce = Vector3.new(5000000, 5000000, 5000000)
    position.P = 100
    position.Velocity = player.Character.HumanoidRootPart.CFrame.LookVector * 90 + Vector3.new(0, 30, 0)
    game.Debris:AddItem(position,.1)

end)

0
use game:GetService("Debris") User#23365 30 — 5y
0
dude TheluaBanana 946 — 5y
0
humanoid:MoveTo() TheluaBanana 946 — 5y
0
But you will go through block Neon_N 104 — 5y

Answer this question