How do I make a draggable shooting button for mobile?

I am trying to make a touch interface shoot button like any mobile fps game where you can hold and drag it to shoot while moving your screen around to aim, I followed this tutorial “https://www.youtube.com/watch?v=MUKAqCHHyQo&t=181s” It works but the only problem is I cant figure out how to get my “OnTouchEneded” function to call once you’ve dragged off the widget and release. so basically it will only be called if I drag my finger back onto the widget and then release, the reason I need this function working is because if I have automatic weapons in the game I need to know when to stop shooting