- Home /
Better line reflection?
this is a print from my game I already have a 2D ball with a physics2D material bounciness 1 and 0 friction so the ball bounces infinitely and I have a line renderer reflection script to aim that works perfectly with physics2D.CircleCast.
but when the ball hits any corner of a square (even if its perfectly lined up with the other corner as in the image) or if it hit's a surface that isn't flat (like a circle, polygon or a corner) the ball doesn't follow the same path as the aim. Im pretty sure that the problem isn't the lineReflection as in the image there is no problem when the surface is 100% flat even diagonally. after some tests I found out that in this occasions the ball collision normal is different from the aimLine normal that is what is causing the problem but I don't know how to solve it any ideas?
Your answer