Hello. I am currently creating a racing game and i would like to add bouncing parts. Currently I have this script that works great, but only to launch the player straight up. What I would like is to be able to tilt the bouncer about 45 degrees and have the bouncer launch the player the direction it is facing. If anyone could help my out or lead me in the right direction that would be great. Thanks!
function touhed(hit)
local hrp = hit.Parent:FindFirstChild("HumanoidRootPart")
local bodyVel = hrp:FindFirstChildWhichIsA("BodyVelocity")
if hrp and bodyVel then
local newVal = Instance.new("BodyVelocity")
newVel.Velocity = Vector3.new(0,100,0)
newVel.MaxForce = Vector3.new(10000, 10000, 10000)
newVel.P = 5000
newVel.Parent = hrp
wait(1)
newVel:Destroy()
end
end