SphereContRot.cs 379 B

1234567891011121314151617
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class SphereContRot : MonoBehaviour {
  5. // Use this for initialization
  6. void Start () {
  7. }
  8. // Update is called once per frame
  9. void Update () {
  10. transform.Rotate(Vector3.forward * Time.deltaTime * 300);
  11. transform.position = new Vector3(2.5f*Mathf.Sin(Time.time * 4) , 1, 0);
  12. }
  13. }