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)
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)
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
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)