RotateMe.cs 395 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class RotateMe : MonoBehaviour
  5. {
  6. public Vector3 VectorAxes;
  7. private Rigidbody rig;
  8. void Start()
  9. {
  10. rig = GetComponent<Rigidbody>();
  11. }
  12. // Update is called once per frame
  13. void Update()
  14. {
  15. rig.MoveRotation(rig.rotation * Quaternion.Euler(VectorAxes));
  16. }
  17. }