Using some simple c# code I would like to create an object and the move and rotate it over time. However the rotation begins to get wonky after a while and eventually results in the object coords moving out of valid world space. Here is some sample code which shows the problem. I seems like the object pivot point is drifting. The problem does not occur if I do not move the object. Any suggestions would be appreciated.
using UnityEngine; using System.Collections; public class Test : MonoBehaviour { GameObject gameobject; // Use this for initialization void Start () { gameobject = GameObject.CreatePrimitive(PrimitiveType.Sphere) as GameObject; gameobject.transform.Translate(10,10,10); } // Update is called once per frame void Update () { gameobject.transform.RotateAround(Vector3.left, 10.0f*Time.deltaTime); gameobject.transform.Translate( 0.1f*Time.deltaTime, 1.0f*Time.deltaTime, 0.1f*Time.deltaTime); } }