Last active
December 1, 2021 04:37
-
-
Save curious-username/b5e1915d324e2d841dbf367c46833df6 to your computer and use it in GitHub Desktop.
EnemyMissileMovement1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Start() | |
{ | |
_playerLocation = GameObject.Find("Player"); | |
if(_playerLocation == null) | |
{ | |
Debug.Log("Player not found"); | |
} | |
} | |
void Update() | |
{ | |
if(_playerLocation != null) { | |
if (gameObject != null) | |
{ | |
Movement(); | |
} | |
} | |
if(_playerLocation == null) | |
{ | |
Destroy(gameObject); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment