Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@curious-username
Created January 3, 2022 02:33
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/ee54b63ae10cfc256d2cd1d1a3c0db68 to your computer and use it in GitHub Desktop.
Save curious-username/ee54b63ae10cfc256d2cd1d1a3c0db68 to your computer and use it in GitHub Desktop.
Laser sweep script
public class BossLaserPivot : MonoBehaviour
{
private GameObject Final_Boss;
Vector3 _direction = Vector3.down;
void Start()
{
Final_Boss = GameObject.Find("Final_Boss");
}
// Update is called once per frame
void Update()
{
PivotCalculation();
transform.Translate(_direction * 4.0f * Time.deltaTime);
if (transform.rotation.z > 0.9914f)
{
LaserShootLeft();
}
if (transform.rotation.z <= 0f)
{
LaserShootRight();
}
//Debug.Log(transform.rotation.z);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment