Hello.
So I have this problem with my moons rotation. This is the script (It’s attached to the planets):
float Distance = transform.localScale.x + Random.Range(10,20);
Instantiate(Moon,new Vector3(transform.position.x + Distance,0,transform.position.z), Quaternion.Euler(0,0,0));
(in Update)
Moon.transform.RotateAround(transform.position, Vector3.up, 0.7f * Time.deltaTime);
The problem is, that moons get placed but they don’t rotate around planets.
I was thinking about attaching the rotation code to the Moon prefab, but I’m not sure how would this work.
-Xentarok
P.S - Forgive me any language mistakes.