Is there a way to make this work with BodyMovers or at least a way for this to work on Characters? I tried every possible way but it either dosen’t work, the player keeps moving forward, or jumps suddenly in the air and nothing happens.
local t = 1;
local mouse = game.Players.LocalPlayer:GetMouse();
local hrp = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart")
mouse.Button1Down:Connect(function()
local g = Vector3.new(0, -game.Workspace.Gravity, 0);
local x0 = hrp.CFrame * Vector3.new(0, 2, -2)
-- calculate the v0 needed to reach mouse.Hit.p
local v0 = (mouse.Hit.p - x0 - 0.5*g*t*t)/t;
-- have the ball travel that path
game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Humanoid").Jump = true
local bv = Instance.new("BodyPosition")
bv.Position = v0
bv.Parent = hrp
game:GetService("Debris"):AddItem(bv, 1)
end)