playMaker

Author Topic: constant bounce  (Read 2718 times)

Gordinho

  • Playmaker Newbie
  • *
  • Posts: 9
constant bounce
« on: March 18, 2017, 10:31:35 AM »
Hello everybody,
I need help on something that looks simple but probably isn't and I can't make it happen. How can I make an object like a sphere bounce between two walls just using one direction (until this point I can do it) but maintaining the same speed?.
Just a sphere going up and down colliding with the up wall and the down wall, one direction, Y for example and maintain the same speed.
I tried with physics material but the speed changes. I know that I could use itween with two points but I need the sphere to move left and right and if the walls change, this wouldn't work.
Can anyone help me with this?.
Thank you.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: constant bounce
« Reply #1 on: March 18, 2017, 11:11:25 AM »
Hi, try this.

Add the bounce material to your sphere. Double click the material to edit it. Make sure bounciness is set to 1. Then set Bounce Combine to "Maximum". This should make it bounce at the same consistent rate.

But it will only bounce as high as you drop the ball from. To add some extra force, try using playmaker action "add force". Try adding "1000" on the Y access. That should get it really bouncing between your two walls.

(Make sure the ball has a rigidbody). On the rigidbody, it has the option to set constraints. Freeze the positions X and Z, if you really want to stop those movements (but I would experiment with this).

Happy bouncing  8)

Gordinho

  • Playmaker Newbie
  • *
  • Posts: 9
Re: constant bounce
« Reply #2 on: March 24, 2017, 09:04:44 AM »
Hi,
thanks for the help. Im going to try that.
How do I make this post "solved"?.
Thank you.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: constant bounce
« Reply #3 on: March 25, 2017, 04:31:21 AM »
I think if you edit your original post, you can change the title there. Then just add the words solved.

Thanks for letting us know it worked out/ is working out.  :)

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: constant bounce
« Reply #4 on: March 26, 2017, 05:48:11 AM »
Or use SetVelocityConstantSpeed3d or SetVelocityConstantSpeed2d

from ecosystem or https://github.com/dudebxl/PlayMakerCustomActions_U5/tree/master/Assets/PlayMaker%20Custom%20Actions/Physics

With this action the force is constant and never changes so it it will always bounce (but you can control the force with the action)