What I’m stuck about is trying to figure out how to use a velocity that allows the player to turn while the velocity is pushing, almost like if the velocity is moving you forward and you can turn left and right, right now I have been struggling, any help would be appreciated
Move the CFrame of the player’s HumanoidRootPart. The look vector can be multiplied by a desired speed to set the velocity in that direction.
like this?
rep.RemoteTools.Charge.OnServerEvent:Connect(function()
print("CHargeeeee")
local charge = Instance.new("BodyVelocity")
local attach = Instance.new("Attachment")
local hitbox = Instance.new("Part")
local main = game.ServerStorage.AxeScript:Clone()
main.Parent = hitbox
attach.Parent = plr.Character.HumanoidRootPart
charge.P = 10000
charge.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
charge.Velocity = plr.Character.HumanoidRootPart.CFrame.LookVector*100
charge.Parent = plr.Character.HumanoidRootPart
hitbox.CFrame = plr.Character.HumanoidRootPart.CFrame
hitbox.Size = hitbox.Size+Vector3.new(3,3,3)
hitbox.CanCollide = false
hitbox.Anchored = true
hitbox.Parent = attach
for i = 1, 40 do
hitbox.CFrame = plr.Character.HumanoidRootPart.CFrame
task.wait()
end
attach:Destroy()
hitbox:Destroy()
end)
end)
Use a LinearVelocity with RelativeTo set to either Attachment0 or Attachment1, whichever is the one under the character.
2 Likes