Decelerate instead of accelerate on bounce

sparkzillasparkzilla Member Posts: 152
edited November -1 in Working with GS (Mac)
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)

Comments

  • sparkzillasparkzilla Member Posts: 152
    Thanks for the sample - I didn't see the Collide behavior before

    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
Sign In or Register to comment.