Prediction of Path For a cannon launching a gameobject

I am creating a canon that will launch the shots on different angles as guided by the user. I want to show a dotted path that will show the prediction of the path that the gameobject will follow. I want to make something like the game BBTan has. Please see below

I also want it to extend and show the reflected path.

My script is as follows,

public Rigidbody2D Cannon;
    public Transform gameobject;
    public float ShootSpeed;
    Rigidbody2D Player;
    float presscount;

    // Use this for initialization
    void Start()
        presscount = 1;


    // Update is called once per frame
    void Update()
        if (presscount == 1)
            if (Input.GetKeyUp("space"))
                Player = Instantiate(Cannon, gameobject.position, gameobject.rotation) as Rigidbody2D;
                Player.AddForce(gameobject.up * ShootSpeed);
                presscount = 0;


Please help… thanks in advance

Good day.

You need to use the following tools/functions.

Component LineRenderer (To generete the line)

Angle reflection function (To calculate the reflexion of the line when reaching the border)

Take your time to read the manuals, watch some tutorials, etc… and you will lern a alot while solve the problem!

Good luck!