Created
January 3, 2022 02:37
-
-
Save curious-username/b096b90f328f7b0c4aeb7540dfabf503 to your computer and use it in GitHub Desktop.
boss pivot pt 2
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 PivotCalculation() | |
{ | |
Vector3 direction = Final_Boss.transform.position - transform.position; | |
direction.Normalize(); | |
float rot_z = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg; | |
transform.rotation = Quaternion.Euler(0f, 0f, rot_z); | |
} | |
void LaserShootRight() | |
{ | |
_direction = Vector3.down; | |
//if (transform.rotation.z > 0.9914f) | |
//{ | |
// gameObject.SetActive(false); | |
//} | |
} | |
void LaserShootLeft() | |
{ | |
_direction = Vector3.up; | |
//if(transform.rotation.z <= 0f) | |
//{ | |
// gameObject.SetActive(false); | |
//} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment