How to Remove Beam when Source or Target are destroyed?

Hello guys,

I’m working on a game in which you can add some dots to the screen and connect them to eachother using a Beam (user is basically setting the beam source and target points with their mouse).

I’ve also added an input which with you can remove the points you’ve added.

When I remove one of the points, I want all the beams connected to that point to be removed. I’ve tried using deactivate, but I usually end up removing only one of the beams connected.

I’d greatly appreciate some help. thanks