How to get slow moving circle to bounce
I posted this earlier but forgot to put it in question format.
In my game, there is a circle actor which bounces around the scene. There is no gravity, friction or drag in my game, and the only scripts in the actor are a Change Velocity and a Collide behavior to collide with the walls. The bounciness is set to 1, but whenever I set its velocity to 66 or under, it will not bounce!! It will just move along the walls until it reaches a corner and gets stuck. When I set its velocity to over 66 it works fine. Is there any way I can get it to go at a speed under 66 and still bounce?
Also, if it hits a vertical wall at an angle of between 45 and 90, it will not bounce at all, no matter what I set the bounciness to.
Best Answers
-
AlchimiaStudios Posts: 1,069
Actually Gamesalad uses Box2d for it's 2d physics engine. I just looked at the faqs/gotchas for some box2d documentation and it seems that there is indeed a threshold for minimum movement speed for a collision with restitution (bounciness). So it's just the way box2d comes configured.
http://www.iforce2d.net/b2dtut/gotchas
See the section "Why do very slow collisions cause no rebound?"
Maybe it can be changed by GS staff, but it is possible it might cause problems.
-
RThurman Posts: 2,880
@Alchimia Studios -- I always wondered why actors bounce poorly at slow speeds! It never occurred to me that it was a Box2D setting. Just in case GS staff ever want to address the issue, here is the critical sentence:
In b2Settings.h you can change the default value (b2_velocityThreshold) for the minimum velocity to consider inelastic. Changing this to a much smaller value should not usually cause any problems.
Answers
Hi @stan_mcginnis maybe you can try turning on "Better Collisions" in Physics tab, good luck
I think 50 is the cut off point for bouncing. So 51+ should work. I'm not entirely sure why that is though.
Follow us: Twitter - Website
Thanks for the help! I decided to just simulate bouncing with change velocity on my slow moving actors.