Answers for "destroy objects when they move below camera unity"

0

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);

}
Posted by: Guest on January-11-2022

Code answers related to "TypeScript"

Browse Popular Code Answers by Language