How do I create a fling pad?

Alredy tried it, didn’t work. Apparently you can’t modify the velocity???

You can, i got this document which uses velocity to change a grenade velocity to a mouse coordinate.
How do I make physics based grenades start with velocity? - Scripting Support - DevForum | Roblox

Did you try out Bodyforce?

I’m changing the parts velocity and adding an overcomplicated debounce so brb

Yes, I did try body force, but it takes a while to do it, like 1 second

I think @Downrest had something, I will test it again to see if it works. I think it went up but maybe we could alter that coding to fling outwards.

local debounce = {}

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:IsA("Model") then
		if table.find(debounce, hit.Parent.Name) then
			return
		end
	else
		if table.find(debounce, hit.Name) then
			return
		end
	end
	if hit.Parent:IsA("Model") then
		table.insert(debounce, hit.Parent.Name)
	else
		table.insert(debounce, hit.Name)
	end
	script.Parent.Velocity = script.Parent.CFrame.UpVector * 500
	wait(.5)
	script.Parent.Velocity = Vector3.new(0,0,0)
	if hit.Parent:IsA("Model") then
		table.remove(debounce, table.find(debounce,hit.Parent.Name))
	else
		table.remove(debounce, table.find(debounce,hit.Name))
	end
end)

WHY DID THiS TAKE SO LONG

5 Likes

! @Snowy_Bacn YOUR A LEGIT ROBLOX EINSTEIN 0-0

1 Like

I also found another solution, the velocity can only be modified in a character script

pad.Touched:Connect(function(part)
	local model = part:FindFirstAncestorOfClass("Model");
	if(model  == script.Parent) then
		script.Parent.PrimaryPart.Velocity = pad.CFrame.LookVector * 100;
	end;
end);

Thats unreliable because of how touched fires, which is why i added a debounce to that

btw i think you have an error because you put if model == script.Parent

Edit: nvm I see it now, I just got confused because u showed a snipet

Oh but then it is basicly the same solution

the parent of the script is the player

local debounce = {}

script.Parent.Touched:Connect(function(hit)
if hit.Parent:IsA(“Model”) then
if table.find(debounce, hit.Parent.Name) then
return
end
else
if table.find(debounce, hit.Name) then
return
end
end
if hit.Parent:IsA(“Model”) then
table.insert(debounce, hit.Parent.Name)
else
table.insert(debounce, hit.Name)
end
script.Parent.Velocity = script.Parent.CFrame.UpVector * 500
wait(.5)
script.Parent.Velocity = Vector3.new(0,0,0)
if hit.Parent:IsA(“Model”) then
table.remove(debounce, table.find(debounce,hit.Parent.Name))
else
table.remove(debounce, table.find(debounce,hit.Name))
end
end)

  • It works! I had a problem on the face. When the player touched the face of the pad they went up :small_red_triangle:

  • When I turned it sideways, and hit the edge, he flung in the expected direction.

The Direction of the “Fling Paths | Fling Direction” is the direction of the fling once pad was rotated.

Mark it as the solution, and format the code, will look better.

Format using ``` from the start to end

Ok… I will have to see how it fits on the main model but all should work well! :smiley:

That is because as you can see from your drawing, the fling direction isn’t exactly paralell to the pad, so it will always fling a bit high.

I cannot believe this took so long

You can also see from my video that I positioned it quite vertical.

@STORMGAMESYT7IP I know lol :rofl: When I started I thought “Hey, this looks easy”… It proved not lol. Thanks guys! I could not have done this without you all! You all literally saved the game and my day :smiley: P.S I will add some perks for ya’ll in the game. I have to go but bye :smiley: :raised_back_of_hand:

1 Like