GGJ2022/Assets/Scripts/BGRotation.cs
GamerClassN7 c8959959f0 Few Range
2022-01-30 11:43:54 +01:00

27 lines
527 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BGRotation : MonoBehaviour
{
private Vector3 rotation;
private void Start()
{
rotation = new Vector3(Random.Range(0, 360), Random.Range(0, 360), Random.Range(0, 360)) * 0.009f;
}
void FixedUpdate()
{
transform.Rotate(rotation);
}
private void OnTriggerEnter(Collider other)
{
if (other.tag == "platform")
{
Destroy(this.gameObject);
}
}
}