I need some help optimizing a weapon effect for my breakout game, PhySix BREAK. So far I have managed to get everything working smoothly except for this one effect. It is a laser sweep that comes out from the player and hits enemies in front of the player. Damage dealt is determined by how long the laser stays in contact with the object. The laser should not be able to pierce the enemy or obstacles. Attached is an example
The problem I am experiencing is it sometimes lags on android and ALWAYS lags on iPhones. Even the X. I really like the laser sweep upgrade. If I can't fix it I will have to scrap it. I am hoping someone can find a more optimized way to make it do the same or behave similarly to the current effect. As it stands, it relies heavily on "on object overlap" which I believe may be part of the problem. Any help would be appreciated