im trying to make the player launch forwards but also rotate forwards some (like a football dive), i want them to rotate based off where theyre looking or humRP is looking at.
local player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local char = player.Character or player.CharacterAdded:Wait()
local HumRP = char:WaitForChild("HumanoidRootPart")
local humanoid = char:WaitForChild("Humanoid")
local diving = false
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then
return end
if not diving then
if input.KeyCode == Enum.KeyCode.E then
diving = true
humanoid.Jump = false
local front = HumRP.CFrame.LookVector
local velocity = HumRP.Velocity
local angleF = (velocity) / (velocity.Magnitude + front.Magnitude)
HumRP.AssemblyAngularVelocity = CFrame.lookAt() -- not really sure what to put here
HumRP.Velocity = Vector3.new(velocity.x,2,velocity.z) * 3.5
humanoid.PlatformStand = true
task.wait(0.5)
diving = false
humanoid.PlatformStand = false
end
end
end)
what im trying to achieve - YouTube – what im trying to achieve
what i currently have made - YouTube – what i currently have created