I am working on a top down little project and I want to make my player bounce off the walls and other objects with a similar force/speed as it collided with it.
However, it is not working. I can make other objects bounce correctly both with the bounce extension and the physics behavior. Whenever I apply the same method to the player object, it doesn’t bounce anymore, it just gets stuck to the wall instead.
I have tried disabling the controller for a fraction of a second after the collision to see if it was interfering, but it doesn’t really work.
How are you moving the object? Can you post a screenshot of those events and the physics behavior settings? It’s tough to read them in a GIF. Make sure you’re applying force using the physics actions not the default or changing the x() or y().
I am moving the object using the top down movement behavior coming from the multitouch controller. It should be applying forces, according to the documentation.
Are you mixing top down movement and physics behaviours? Use one or the other, but not both. They don’t mix very well.
Also, if you are using top down behaviour, how can it bounce off the wall? Pressing right will keep moving it to the right, negating any bounce to the left.
Also, restitution is a value between 0 and 1 - absorb all energy and absorb no energy.
How do I use the multitouch controller with physics? I thought that, as the documentation says that it generates a force, it was exactly thought to use mixed with physics. Can you help?
That doesn’t make too much sense to me, so I beg your patience My logic behind this was that if the acceleration to the right was lower than the bounce force, it would still bounce. Like if I drive a RC car into a wall, full throttle, it still bounces back, then reaccelerates to the right.
Still: if you see the GIF, you will see that at the moment of collision, the controller is not pressed.
Thank you. I saw somewhere else that I should set it to >1 to see if it bounced.
IDK if the top-down behavior generates forces. If it does it’s not the same forces as the physics behavior. It might be a continuous instant force instead of permanent. IDK. The top-down also generates ,or reduces a “force” to decelerate. The issue is it’s applying 2 “forces” and they’re competing. One will either undo or overpower the other. The bounce would have to be more powerful than the force being applied.
Here’s simple example using the pad and applying force. It’s a bit like flying a spaceship.