Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

2d Solar System

Discussion in '2D' started by Uhmari, Nov 18, 2013.

Thread Status:
Not open for further replies.
  1. Uhmari

    Uhmari

    Joined:
    Nov 18, 2013
    Posts:
    13
    Im trying to create a solar system that has orbiting, Like this

    $ui410.jpg

    Can someone please give me a walk through, thanks
    I want the planets to orbit the sun.
     
  2. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    I imagine that you already have the sprites!
    So... the sun would be the point for the planets to rotate. Your planet must be a Child of a parent empty game object.
    the parent position will be the same position where the sun is! and the child (planet) position will be the distance from the sun!

    All you have to do is rotate the parent Z axis! then your planet will simulate an orbit!
    Ps.: I can't post any image example right now, because I'm not on my computer, i can post an example later if you don't understand what I'm saying.

    Best regards,
    PJRM
     
    MounirDev likes this.
  3. Uhmari

    Uhmari

    Joined:
    Nov 18, 2013
    Posts:
    13
    So to make it a child, I just drop it (sphere 1) on top of sphere 2, so it hides if i click the < Then its parented?

    Can you give me a step by step process

    Create Sphere> Etc
    Im new with this program
     
    Last edited: Nov 18, 2013
  4. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    [Arrived home]
    Here it is a simple Image:
    $SSUnity3D_OrbitExplanation.jpg
    1. GameObject > Create Empty Object
    2. GameObject > Create Sphere
    3. Drop the Sphere inside the EmptyGameObject (Hierarchy)
    Done!
    - The GameObject must be the same position where your Sun will be!
    - The Sphere Object you'll change the position to it be the distance from the sun!
    - The last tip: You must only rotate the EmptyGameObject on Z

    if you follow there is no mistakes.

    Att.,
    PJRM.
     
    Last edited: Nov 18, 2013
  5. Uhmari

    Uhmari

    Joined:
    Nov 18, 2013
    Posts:
    13
    i think you misunderstood, i wanted to make the planets orbit the star, not just move around it. I want it animated so they orbit in a realistic manner, so that when a player is playing the game, and he colonizes the planet, the solar systems seem realistic
     
  6. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    Well. i know what you mean, althought to be realistic, each planet has your own Orbit speed according to the distance of the sun. You must calculate it. I just show you a simple way to do it.

    Animation Editor - I'm really sorry, but I'm a noob with this tool (yet).

    So... You could just attach a script which have a array of planets. you can do it dynamic. when more distance more slow would be the rotation of the planet. I'd do that way. Your scene will be static!? the amount of stars, galaxy or universe!? if it is, so... Just one animation per planet solves you problem.

    Well, I tried.
    Good luck.

    Att.,
    PJRM
     
Thread Status:
Not open for further replies.