Decelerate instead of accelerate on bounce
sparkzilla
Member Posts: 152
I have an actor that is accelerating towards the right. On collision with a wall I want it to bounce back to the left and continue to accelerate at the same rate as before. Instead it decelerates back to zero.
Here's what I have:
On collision with wall
(self.motion. linear velocityx) =-(self-motion.linear velocity x)
Here's what I have:
On collision with wall
(self.motion. linear velocityx) =-(self-motion.linear velocity x)
Comments
In your example though the moving actor still decelerates after hitting the wall. I changed the restitution value and that seems to make it accelerate back off the wall. I need to find a neutral restitution value that will allow the return acceleration to be controlled by the acceleration behavior