How do I make responsive trampoline bricks in the new physics engine?

In the old physics engine I was able to make trampoline bricks by changing the velocity of the part to Vector3.new(0, bounceHeight, 0). However this doesn’t work with the new Physics engine as it barely launches players into the air anymore.

I have tried making my own by having a localscript inside a player which detects when they touch trampoline parts, then puts an upwards bodyforce into their humanoidrootpart for a second or two to launch them upwards, but it is unresponsive as the jump height is dependent on the mass of the character and all their hats combined.

Why is it so awkward to make trampolines? Does anyone have an idea as to what the correct approach would be?

2 Likes

Try using BodyVelocity. It will apply force to reach the target velocity regardless of character weight.

With PGS you can use custom physical properties to give parts a high (even perfect) elasticity:

https://gfycat.com/LankyPassionateAardvark

but this only preserves existing momentum – it doesn’t create new momentum – so your player will only bounce as high as they can jump. You can’t make them go higher. Plus humanoids ignore elasticity of parts, regardless of that part’s ElasticityWeight.

4 Likes

I switched to body velocity and I am still noticing a reduction in bounce height if the character is for example equipping a tool or something. It does definitely feel smoother than BodyForce but it isn’t eliminating the variance in character mass issue.

Could you give the BodyForce a Force based on the mass of the player and all of their parts? You should be able to use that the same way that it’s used to have no gravity on a character or model.


You could repurpose the code in this recent thread and change game.Workspace.Gravity to whatever force you would like. This should give a consistent force regardless of the character mass. If you want the player to move upwards, you’ll need a force greater than that needed to counter gravity, such as game.Workspace.Gravity + 10

1 Like

I was trying to solve this issue manually for a prototype game I was working on called “TAG!”, as one of the mechanics involved trampoline-like surfaces. Since the elasticity property doesn’t work on Humanoids, I had to create custom character objects that didn’t use Humanoids in order to truly remedy the solution and use the easy physics-based method.

Of course, non-humanoid characters aren’t always an easy nor viable option. I’m unsure what the best method is. It would likely be something with BodyVelocity as everybody else is saying. The only way I could see that’d make it possible to have some form of velocity reflection would be to store the character’s velocity would be kind of ridiculous.

You could have a BodyVelocity in the root part of the character with its MaxForce set to 0 on all axis, and while the player is falling (Maybe check the root’s velocity on Y and if it’s < 0) you set the Velocity property on the BodyVelocity. From then you’d have to do some method of detecting part hits, and should they hit a trampoline surface, run BodyVelocity.Velocity = BodyVelocity.Velocity * -1 and set its MaxForce to [0, inf, 0].

Otherwise, I say the best method is really custom characters + elasticity, because the above method is rather insane and I haven’t been able to find a viable method otherwise.

In the old physics engine I was able to make trampoline bricks by changing the velocity of the part to Vector3.new(0, bounceHeight, 0). However this doesn’t work with the new Physics engine as it barely launches players into the air anymore.

Does anyone know why the new physics engine doesn’t launch the player into the air by setting the Velocity property, as described by Ripull? To me, this seems to be the logical thing to happen, so why has it changed? Was this change intentional?

1 Like