Make proper trampoline system

i want to make proper trampoline system for my game

i want it to bounce me the same height and keep the same speed

ive been trying many methods including: body velocity (it kept slowing me down), assemblylinearvelocity (it just bounces me high when it feels like it, as shown in the video), jumpheight method (it kept delaying). i have been searching everywhere in the toolbox, devforum and even chat gpt

assemblylinearvelocitymethod: (i set it to 0, 250, 0)

body velocity method:

local ts = game:GetService("TweenService")

script.Parent.Touched:Connect(function(part)
	local humanoidrootpart = part.Parent:FindFirstChild("HumanoidRootPart")
	if humanoidrootpart then
		local force = Instance.new("BodyVelocity")
		force.Parent = humanoidrootpart
		force.MaxForce = Vector3.new(25000000000000000, 2500000000000, 2500000000000000)
		force.P = 50000000000000
		force.Velocity = Vector3.new(0, 75, 0)
		if script.Parent.Boing.Playing == false then
			script.Parent.Boing:Play()
		end
		ts:Create(script.Parent.Mesh, TweenInfo.new(0.25, Enum.EasingStyle.Bounce), {Scale = Vector3.new(3.5, 1, 3.5)}):Play()
		task.wait(0.25)
		ts:Create(script.Parent.Mesh, TweenInfo.new(0.6, Enum.EasingStyle.Bounce), {Scale = Vector3.new(7.5, 15, 7.5)}):Play()
		task.wait(0.75)
		ts:Create(script.Parent.Mesh, TweenInfo.new(1, Enum.EasingStyle.Bounce), {Scale = Vector3.new(5, 3.75, 5)}):Play()
		force:Destroy()
	end
end)

jumping method:

local ts = game:GetService("TweenService")

script.Parent.Touched:Connect(function(part)
	local humanoid = part.Parent:FindFirstChild("Humanoid")
	if humanoid then
		humanoid.JumpHeight = 50
		humanoid.Jump = true
		if script.Parent.Boing.Playing == false then
			script.Parent.Boing:Play()
		end
		ts:Create(script.Parent.Mesh, TweenInfo.new(0.25, Enum.EasingStyle.Bounce), {Scale = Vector3.new(3.5, 1, 3.5)}):Play()
		task.wait(0.25)
		ts:Create(script.Parent.Mesh, TweenInfo.new(0.6, Enum.EasingStyle.Bounce), {Scale = Vector3.new(7.5, 15, 7.5)}):Play()
		task.wait(0.75)
		ts:Create(script.Parent.Mesh, TweenInfo.new(1, Enum.EasingStyle.Bounce), {Scale = Vector3.new(5, 3.75, 5)}):Play()
		humanoid.JumpHeight = 7.2
	end
end)

please help me i appreciate it

Probably since its in touched event so there is collision and a bouncing force.

Try messing around with custom physical properties to remove the bounce.

Or probably something like runservice.Stepped:Wait() to overwrite the physics.

1 Like

Try ApplyImpulse instead.

1 Like

can you give a specific example about it?

how can i use it?

Summary

fjiasdjiasjifisaij

ApplyImpulse should be applied a basepart, for the player, apply it to their HumanoidRootPart

Example:

HumanoidRootPart:ApplyImpulse(Vector3.new(0,20,0)) - upwards
2 Likes

As @Electrico11HD said, apply it to the HRP, but if 0,20,0 doesn’t work just change the 20 to 50, or 100, or 1000 and test it until you get the desired bounce height

1 Like