Skip to content

Instantly share code, notes, and snippets.

@curious-username
Created January 3, 2022 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curious-username/b096b90f328f7b0c4aeb7540dfabf503 to your computer and use it in GitHub Desktop.
Save curious-username/b096b90f328f7b0c4aeb7540dfabf503 to your computer and use it in GitHub Desktop.
boss pivot pt 2
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