Trampoline doesn't work

Hello people of the Fourms,
I need help with a moving trampoline for my game. when the trampoline is at a standstill, it works fine. but the trampoline is constantly moving, and doesn’t work.

The trampoline part is a part in a model, which is moving using AssemblyLinearVelocity.
This script is attached to a different part inside the model:

while true do
	script.Parent.AssemblyLinearVelocity = script.Parent.CFrame.LookVector * -10
	wait(0.1)
end

Trampoline Script:

local part = script.Parent
part.AssemblyLinearVelocity = Vector3.new(0,250,0)

Thank you in advance,
NotUD

1 Like

Try affecting the player with the force instead of the trampoline part.

local part = script.Parent

part.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local HRP = hit.Parent:FindFirstChild("HumanoidRootPart")
        
        HRP.AssemblyLinearVelocity += Vector3.new(0, 250, 0)
    end
end)

It works, but it’s super inconsistent. Do you know a way to make it so that the bounce is consistent?

Try using part:GetTouchingParts() to return a table that contains parts that are physically touching.

while task.wait() do
    local touchingParts = part:GetTouchingParts()

    for i, part in touchingParts do
        if part.Parent:FindFirstChild("Humanoid") then
            local HRP = part.Parent:FindFirstChild("HumanoidRootPart")
        
            HRP.AssemblyLinearVelocity += Vector3.new(0, 250, 0)
        end
    end
end
1 Like

If your trampoline stops bouncing while it’s moving, it’s likely a physics issue with velocity being overwritten. Try this:
part.AssemblyLinearVelocity += Vector3.new(0, 250, 0)
This adds upward velocity without removing the platform’s movement, keeping the bounce consistent. Let me know if it helps!

Thank you @J_Angry, because I got ideas from your script to make a script that works

local part = script.Parent


part.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		hit.Parent:FindFirstChild("HumanoidRootPart").Velocity = Vector3.new(0, 100, 0)
	end
end)
2 Likes

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