How to make a bounce pad launch a player in the direction the top is facing

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    

So what u wanna do is reference the bouncepad and get the UpVector like this.

local Bouncepad = define it.
local BounceStrength = 25
local Direction = Bouncepad.CFrame.UpVector

local newVal = Instance.new("BodyVelocity")
newVel.Velocity = Direction * BounceStrength
1 Like

Ohhh okay this works thank you

1 Like