Skip to content

Instantly share code, notes, and snippets.

@kwalkerxxi
Forked from kurtdekker/DestroyOnAwake.cs
Created February 6, 2025 11:47
Show Gist options
  • Save kwalkerxxi/1d772f165df5ad3821963e38a0ac71f5 to your computer and use it in GitHub Desktop.
Save kwalkerxxi/1d772f165df5ad3821963e38a0ac71f5 to your computer and use it in GitHub Desktop.
a way to put design elements in your Unity scene so they disappear when you play.
using UnityEngine;
// @kurtdekker - Attach this script to GameObjects you
// want to have in your scene for alignment and design,
// but you want to be destroyed during real gameplay.
public class DestroyOnAwake : MonoBehaviour
{
void Awake()
{
// and you can comment this out and run and you will have
// all your guides still in project at runtime!!
Destroy(gameObject);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment