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