RollingSphere.cs 398 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class RollingSphere : MonoBehaviour
  5. {
  6. private Rigidbody sphere;
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. sphere = GetComponent<Rigidbody>();
  11. }
  12. // Update is called once per frame
  13. void Update()
  14. {
  15. sphere.AddTorque(0,0,1);
  16. }
  17. }