Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

destroy objects when they move below camera unity

void Update()
{
    Vector2 screenPosition = Camera.main.WorldToScreenPoint(transform.position);
    if (screenPosition.y < (Screen.height - 300f))
    Destroy(this.gameObject);

}
 
PREVIOUS NEXT
Tagged: #destroy #objects #move #camera #unity
ADD COMMENT
Topic
Name
7+4 =