feat: new rotatemovement script

This commit is contained in:
Chris
2026-01-01 20:59:32 -05:00
parent 5e770613bc
commit 0a1a6a6c65
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System;
using UnityEngine;
using Random = UnityEngine.Random;
public class RotateMovement : MonoBehaviour
{
public float rotateSpeed;
public Vector2 randomOffsetRange;
public Vector2 randomSpeedRange;
private float randomSpeed;
// Update is called once per frame
private void Start(){
randomSpeed = Random.Range(randomSpeedRange.x, randomSpeedRange.y);
transform.Rotate(Vector3.forward * Random.Range(randomOffsetRange.x, randomOffsetRange.y));
}
void Update()
{
transform.Rotate(Vector3.forward * ((rotateSpeed + randomSpeed )* Time.deltaTime) );
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 8e539b16d7f9f6a4e8a444da0137add4