Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Aug 25, 2013 at 03:31 PM by AlucardJay for the following reason:

The question is answered, right answer was accepted (formerly closed for asking for code)

avatar image
0
Question by d112570 · Aug 25, 2013 at 02:17 PM · rotateorbit

How do you move multiple objects in an orbit?

I would like a short script like choose GameObject (object that orbits like a planet) and parentObject (stable object that others orbit around like a star) in the inspector. I tried the bottom script it works but all the planets rotate at the same speed. In the following script I was unable to select this GameObject, just the parentObject.

transform.RotateAround(SystemSizeSetup[i].orbitData.parentObject.position, SystemSizeSetup[i].orbitData.parentObject.up, SystemSizeSetup[i].orbitData.Speed*Time.deltaTime);

I need something where I can choose this planet X move at this speed to rotate around this star, and this planet Z at this speed to rotate around the same star.

Thanks.... :-)

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Aug 25, 2013 at 02:23 PM 0
Share
  1. Format your code

  2. Don't ask for scripts

Sorry, but your question is not suitable for Unity Answers. Please use the Unity Forum for discussions such as "How to ...". Unity Answers is here to help you solve any specific problems you have.

  • http://forum.unity3d.com/

  • http://answers.unity3d.com/page/newuser.html

  • http://video.unity3d.com/video/7720450/tutorials-using-unity-answers

avatar image fafase · Aug 25, 2013 at 02:25 PM 0
Share

It is there http://unitygems.com/basic-ai-space-shooter/. Just remember to use planets ins$$anonymous$$d of space ships.

avatar image d112570 · Aug 25, 2013 at 02:41 PM 0
Share

I don't get it, why was it closed, there are a lot of similar question of objects orbiting planets? A lot of people ask the How question, I already have the script I wrote, I pasted it here. I asked how questions before and never got kicked out.

avatar image fafase · Aug 25, 2013 at 02:44 PM 0
Share

Well, whatever the reason is, I gave you a solution. have a look there you will find all you need in the spinning around section.

avatar image AlucardJay · Aug 25, 2013 at 02:52 PM 1
Share

I closed this question because you asked for a script. Despite the many answers where people are giving away scripts, this is not the purpose of Unity Answers, UA is for when you have a script but it is not producing the desired results.

Don't be offended, just create a new thread in the scripting section of the forums. The forums are fantastic, there you can ask for scripts on how to implement an idea, you will find many people that will help and provide code you are looking for, and often also assist you in the further development of your idea.

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by d112570 · Aug 25, 2013 at 03:25 PM

I solved it my self, here is the script.

 SystemSizeSetup[i].gameObject.transform.RotateAround(SystemSizeSetup[i].orbitData.parentObject.position, SystemSizeSetup[i].orbitData.parentObject.up, SystemSizeSetup[i].orbitData.Speed*Time.deltaTime);


Now all planets rotate according to their speed. And to the web page you gave me, that was way too much scripting and difficult. I was only looking for 1 line script, I didn't know I was able to add "SystemSizeSetup[i].gameObject." to the front of my script, I tried it out just for fun and it works perfectly. The word "Format your code" helped, I was thinking about that for like 30 min, till I understood it.

How can I add this to the answered list since its closed?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Help with camera movement using mobile input 0 Answers

Having trouble making my camera orbit an object 2 Answers

Move camera around object IOS 2 Answers

Making an object rotate around a sphere 1 Answer

Camera Orbit Rotation Problem 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges