Skip to content

Instantly share code, notes, and snippets.

@curious-username
Created December 18, 2021 23:34
Show Gist options
  • Save curious-username/aaff52a8957c5f2cd55a88700b5900ec to your computer and use it in GitHub Desktop.
Save curious-username/aaff52a8957c5f2cd55a88700b5900ec to your computer and use it in GitHub Desktop.
start of missileenemy
void Start()
{
Instantiate(_missile, transform.position, Quaternion.identity);
_playerObject = GameObject.Find("Player");
if (_playerObject != null)
{
_player = _playerObject.GetComponent<Player>();
if (_player == null)
{
Debug.Log("_player is null");
}
}
_explosionSound = GetComponent<AudioSource>();
if (_explosionSound == null)
{
Debug.Log("Sound Not Found");
}
_explosion = GetComponent<Animator>();
if (_explosion == null)
{
Debug.Log("Explosion Animation Not Found");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment