Advertisement
MariuszPoz

Rotating Sphere

Oct 27th, 2023
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.31 KB | Gaming | 0 0
  1. using UnityEngine;
  2.  
  3. public class RotateSphere : MonoBehaviour
  4. {
  5.     public float rotationSpeed = 20f; // 20 degrees per second
  6.  
  7.     void Update()
  8.     {
  9.         // Rotate the sphere by the specified speed around its up (Y) axis
  10.         transform.Rotate(Vector3.up * rotationSpeed * Time.deltaTime);
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement