Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Gordinho 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.
-
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)
-
Hi,
thanks for the help. Im going to try that.
How do I make this post "solved"?.
Thank you.
-
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. :)
-
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)