# Problem with Ball Bouncing after Collision

I am Making a Circle Pong Clone, in that the ball doesn’t have a Good Bouncing behaviour i want ball behaviour like in this Video Circle Pong iOS App | Gameplay Trick + Highscore! - YouTube here is the Code of Ball

Here is what i have Achieved https://drive.google.com/open?id=1kJeD3OfBn6XWoFB15Lern39lZ2oX9EWZ

``````using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ball : MonoBehaviour
{
public Rigidbody2D rb;
public Transform centerPoint;
public float force;
public Vector2 direction;

Vector3 startPosition;
float angle;

void Start()
{
startPosition = transform.position;
rb = GetComponent<Rigidbody2D>();
Invoke("Move", 2f);
InvokeRepeating("GameOver", 1.0f, 0.8f);
}

void Move()
{
direction = new Vector2(0.5f, -1f);
}
void OnCollisionEnter2D(Collision2D col)
{
Vector2 norm = col.contacts[0].normal;
Bounce(norm);

}
void Bounce(Vector2 normal)
{
normal = normal.normalized;
Vector2 newDirection = Vector2.Reflect(direction, normal);
newDirection = newDirection.normalized;
direction = newDirection;

// angle = Vector2.Angle()

}

//void CalculateAngel()
//{

//}
void GameOver()
{
if (Vector3.Distance(transform.position, centerPoint.position) > 1.2f)
{
rb.Sleep();
transform.position = startPosition;
CancelInvoke("GameOver");
Invoke("Restart",0.1f);
}
}

void Restart()
{
Invoke("Move", 2f);
InvokeRepeating("GameOver", 2.0f, 0.8f);
}
}
``````

This Script is added to Ball along with Rigidbody & Circle Collider with a PhysicsMaterial2D Added Anyhelp

@NALAYAK A small gif/video would be helpful in understanding how the ball is bouncing in your case.
Never the less, make the ball kinematic then it would respond just to the code.

@NALAYAK No need to write scripts… Just create a physics material in project tab by rightclicking then selecting create then select physcis material and set bounce to one… Play with other properties to get desired result then drag this material to the tab in the collider component attached to the gameobject… I hope this should work.