# Bounce object off ray cast relative to self?

I have a ray cast and all physics set up, but I want to dynamically do something like this:
http://imgur.com/wI0SudR
So when the ball overlaps with the ray cast, I want it to bounce the ball based on the side it collided with. In other words I want to apply force to a single point of the object.

First off, I’m assuming you know when the ball hits the ray cast. I’m also assuming the ball is a physics object. Next, you find the vectorized angle of the raycast and add 90º to it (like the math here: http://stackoverflow.com/questions/11773889/how-to-calculate-a-vector-from-an-angle-with-another-vector-in-2d). Finally, when the ball hits the raycast, set the linear velocity of the the ball to the angle of the raycast.
Another method is simply to have an edge body type that the ball bounces off of.

@Zoyt I made it an EDGE. But the object doesn’t bounce very high, can I make the edge bouncier?

Change the restitution of the object

Thanks! That works great