leomovskii

SawScript.cs

Oct 28th, 2021 (edited)
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class SawScript : MonoBehaviour {
  6.  
  7.     public float speed = 2f; // швидкість обертання
  8.     public bool direction = true; // напрямок обертання
  9.  
  10.     void FixedUpdate() {
  11.         transform.Rotate(0f, 0f, speed * (direction ? 1 : -1)); // повертаємо об'єкт через його трансформу
  12.     }
  13. }
Add Comment
Please, Sign In to add comment