Skip to content

Instantly share code, notes, and snippets.

@hpcergar
hpcergar / example.cs
Created March 29, 2022 19:48
Unity: check if an object is visible for the main camera
using UnityEngine;
public class Example : MonoBehaviour
{
// Cache variables
Camera cameraInstance;
Transform currentTransform;
// State