Hi,
I am very very new to Unity and I couldn’t find an answer to this through searching the forums. I’m trying to fake a solar system by having planets orbit around the origin using Transform’s RotateAround method. However, nothing seems to happen. I have attached the script (named MercuryOrbit) to a sphere mesh that I created inside Unity which is located at 8,0,0. I also tried creating an empty GameObject, applying the script to that, and parenting the sphere to this empty GameObject. Still no luck. I think I am missing something silly. By the way, I had to add an “F” to 0.0001 to get it to compile in C#. Does javascript not need to do this?
using UnityEngine;
using System.Collections;
public class MercuryOrbit : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
// spin the object around the world origin at 20 degrees/second.
transform.RotateAround (Vector3.zero, Vector3.right, 0.0001F * Time.deltaTime);
}
}