Rotate.cs 309 B

1234567891011121314151617
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Rotate : MonoBehaviour
  5. {
  6. public Transform target;
  7. public Vector3 axis;
  8. public float speed;
  9. private void Update()
  10. {
  11. target?.Rotate(axis * speed * Time.deltaTime, Space.Self);
  12. }
  13. }