How do I launch a player upwards?

I’m trying to make a mechanic where a player would touch a launchpad and be launched upwards. The LaunchPad part is in game.Workspace and has a NumberValue called “Speed” that is a value of 20. The part flashes when I touch it, but does not send the player upward. There is also nothing in the output. How would I fix this?

local TS = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local char = player.Character
local hum = char:WaitForChild("Humanoid")
local rootpart = char:WaitForChild("HumanoidRootPart")

local LaunchPad = game.Workspace.LaunchPad
local LaunchPower = LaunchPad.Speed
local LaunchDebounce = false

LaunchPad.Touched:Connect(function(touched)
	if touched.Parent:FindFirstChild("Humanoid") and LaunchDebounce == false then
		LaunchDebounce = true
		LaunchPad.Color = Color3.fromRGB(255, 255, 255)
		rootpart:ApplyImpulse(Vector3.new(0, LaunchPower, 0))
		task.wait(0.1)
		local LaunchTween = TS:Create(LaunchPad, TweenInfo.new(0.6), {Color = Color3.fromRGB(58, 158, 93)})
		LaunchTween:Play()
		LaunchTween.Completed:Connect(function()
			LaunchDebounce = false
		end)
	end
end)
1 Like

You can use BodyPosition, LinearVelocity and JumpPower modificationsa

for example

local LV = Instance.new("LinearVelocity")
LV.Name = "BOOST"
LV.MaxForce = Vector3.one * math.huge
LV.Velocity = rootpart.CFrame.UpVector * LaunchPower
LV.Parent = roopart
game.Debris:AddItem(LV, .5)--lifespan = 0.5
3 Likes

Thanks, I also noticed that LaunchPad.Speed should be replaced with LaunchPad.Speed.Value. Will try your solution now

2 Likes

It says Velocity is not a valid member of LinearVelocity "BOOST"

I don’t remember the proprety for that im gonna look it up rq

1 Like
local LV = Instance.new("BodyVelocity")
LV.Name = "BOOST"
LV.MaxForce = Vector3.one * math.huge
LV.Velocity = rootpart.CFrame.UpVector * LaunchPower
LV.Parent = roopart
game.Debris:AddItem(LV, .5)--lifespan = 0.5

switched it to bodyvelocity cause its simpler to use, should work now :+1:

2 Likes

If u wanna use LinearVelocity check this post out

It launched me forwards instead of up

Change LookVector to UpVector in that script

1 Like

It works, ty!

PS: LinearVelocity is the newer but complicated version of bodyvelocity. (Use whichever you want but watch out cuz BodyVelocity is not supported)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.