hi,
My problem is bounce reflection. I tried to explain my problem with pictures.
Green Line : Ball direction
Red Line : Collision.contact.normal.
Cyan Line : Reflected direction
- Everything is okey at this picture. Reflection is perfect.
- Wrong! Left ball direction is up (2x Speed) Right ball direction is up(1x speed).
Second ball is going to wrong direction, when first ball touched to it
void OnCollisionEnter2D(Collision2D collision)
{
ContactPoint2D contact = collision.contacts[0];
var reflek = (Vector2)Vector3.Reflect(this.Way,contact.normal);
this.Way = reflek
}