How to create ball boost pad

I am trying to make the boost pad seen below function.
https://gyazo.com/329eccef98fe12f6d85d952adc0b7442

However, what I tried has no effect on it and I do not know what else to try.
My current code is:

script.Parent.Touched:Connect(function(Hit)
	if Hit.Parent.Name == "BALLS" then
		local Character = workspace.CHARACTERS:FindFirstChild(Hit.Name)
		local BodyVelocity = Instance.new("BodyVelocity",Hit)

		local Orientation = Character.HumanoidRootPart.Orientation
		
		BodyVelocity.P = 0
		BodyVelocity.MaxForce = Vector3.new(0,0,0)
		BodyVelocity.MaxForce = Vector3.new(Orientation.X,0,0)
		
		BodyVelocity.Velocity = Vector3.new((Orientation.X + 1) * 100,0,0)
	end
end)

Any help or suggestions are much appreciated.

1 Like

disable character gravity maybe.

1 Like

I tried this but it did not work.

1 Like

Why are you setting MaxForce twice?

Instead try something like, BodyVelocity.Velocity = Vector3.new((Orientation.X + 1, 0, 0) * 100, 0, 0

Once again didn’t work, why are you setting extra 0’s…

I don’t know why its not working.

try printing something after this if statement.

I already know it reaches the end I have already done prints.

1 Like

Try this:

script.Parent.Touched:Connect(function(Hit)
	if Hit.Parent.Name == "BALLS" then
		local Character = workspace.CHARACTERS:FindFirstChild(Hit.Name)
		local BodyVelocity = Instance.new("BodyVelocity",Hit)

        local multiplier = 100 -- Change this amount.

		local lookVector = Character.HumanoidRootPart.CFrame.lookVector
		
		BodyVelocity.P = 0
		BodyVelocity.MaxForce = lookVector * multiplier
		
		BodyVelocity.Velocity = lookVector * multiplier
	end
end)

Is your script inside of ball?

I will try this in 10ish minutes when I get back on. Which script are you referring to when you say “Is your script inside of ball?”? If you mean the booster script, it is one script that controls all the boost pads, coins, spinners, etc. in ServerScriptService.

It still isn’t working. The BodyVelocity is created in the ball and everything but the ball remains unaffected. I am using this system by EgoMoose as the ground work of my game. Maybe something in it is preventing boosts from working?

I meant script that you showed.
I ask this because if so, your code should look like this:

script.Parent.Touched:Connect(function(Hit)
	if Hit.Name == "YOUR JUMP PAD NAME HERE" then
		local Character = workspace.CHARACTERS:FindFirstChild("PATH TO PLAYER'S CHARACTER") -- as argument you should pass player's Character, not a boost pad
		local BodyVelocity = Instance.new("BodyVelocity",Hit)

        local multiplier = 100 -- Change this amount.

		local lookVector = Character.HumanoidRootPart.CFrame.lookVector
		
		BodyVelocity.P = 0
		BodyVelocity.MaxForce = lookVector * multiplier
		
		BodyVelocity.Velocity = lookVector * multiplier
	end
end)

Oh yea no it is not inside of the ball, it is a script in ServerScriptService. I really think that the ball system EgoMoose created is affecting the ball’s ability to be affected by BodyVelocitys, but I cannot figure out how to fix this.

But then why are you doing this if script’s parent is ServerScriptService? ServerScriptService is not a part and can’t be touched.

Sorry I got confused about where the script is, my bad. It is in the boost pad.

Then is ball has player’s сharacter name? This code executes every time something touched boost pad and if hit.Parent.Name equals to “BALLS”(probably a folder where all balls are) then you are trying to find character, whose ball touched boost pad, which means ball’s name should be same as character’s name.

Yes, it is named the same as the player.

I’m not sure what does P mean, but maybe try changing it to higher amount? Also use lookVector instead of Orientation.

I found out that I can make a bool inside of the ball to toggle when they hit the boost pad, then in the module by EgoMoose I can check if that is true, if it is set the speed higher, if not set it default.

1 Like