Making a bubble pop game type of shot trajectory

So I am working on a game and I’m wanting my shot trajectory prediction to act similar to that in Bubble Pop. If you are unfamiliar with what I’m talking about see picture below.
[183118-bubblepop.jpg*_|183118]

Basically, I want my trajectory be able to predict the line my object will follow when it bounces off of walls or obstacles. Either that or make it so my current line detects an obstacle and stops making the line when it collides with and obstacle (similar to peggle). Below is currently how my trajectory prediction sits as well as my code. What could I add to make this perform how I want it to? Currently my bullet does bounce off of colliders, the trajectory just does not show that.
[183119-screenshot-8.png*_|183119]

public class Gun : MonoBehaviour
{
    public GameObject bullet;
    public float launchForce;
    public Transform shotPoint;

    public GameObject point;
    GameObject[] points;
    public int numberOfPoints;
    public float spaceBetweenPoints;
    Vector2 direction;

    private void Start()
    {
        points = new GameObject[numberOfPoints];
        for (int i = 0; i < numberOfPoints; i++)
        {
            points *= Instantiate(point, shotPoint.position, Quaternion.identity);*

}
}

void Update()
{
Vector2 bowPosition = transform.position;
Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
direction = mousePosition - bowPosition;
transform.right = direction;

if (Input.GetMouseButtonDown(0))
{
Shoot();
}

for (int i = 0; i < numberOfPoints; i++)
{
points_.transform.position = PointPosition(i * spaceBetweenPoints);_
}
}

void Shoot()
{
GameObject newBullet = Instantiate(bullet, shotPoint.position, shotPoint.rotation);
newBullet.GetComponent().velocity = transform.right * launchForce;
}

Vector2 PointPosition(float t)
{
Vector2 position = (Vector2)shotPoint.position + (direction.normalized * launchForce * t) + 0.5f * Physics2D.gravity * (t * t);
return position;
}
}
----------
_*
_*

Watch this tutorial:

Here is the code for that tutorial:

even though it’s in 3d the concept is still the same