Hi, instead of adding a new box collider, I just created a script for the lasers and checked that, relative to the camera world view, the laser is outside the max y range, and if it is destroy itself:
Script PlayerLaser:
void Update()
{
if (transform.position.y > Camera.main.ViewportToWorldPoint(new Vector2(0,1)).y)
{
Destroy(gameObject);
}
}
and I could check that the laser is outside the (0,1) boundary for x too, in case we add another type of laser that goes sideways or diagonal instead of just up.
Is there any downside to this approach?
Thanks!
Luis.