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 post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by ahmedibrahim · Feb 21, 2013 at 12:39 PM · unityengineobject

Create Circular Motion to follow the object

Hello, im new in unity and need help to create Circular Motion, i starting to create satellite motion and i would like do it, when satellite starting rotate round the earth should have Circular Motion to follow the satellite and show direction to satellite, i'll post some image show exctelly what i want, also i can have some example explain how upload music in unity3d, include music to simulation and start / stop music button. thanks alt text

image1.gif (6.6 kB)
image.gif (46.8 kB)
Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by AlucardJay · Feb 25, 2013 at 04:40 PM

You can use Rotate as in the answer by robertblu (with the child satellite at an offset to the parent gameObject), or define a Vector3 to RotateAround : http://docs.unity3d.com/Documentation/ScriptReference/Transform.RotateAround.html

 var target : Transform; // drop what you want the satellite to rotate around here in the inspector
 var orbitSpeed : float = 10.0;
  
 function Update() 
 {
     transform.RotateAround( target.position, Vector3.up, orbitSpeed * Time.deltaTime );
 }

  • Attach this script to your Satellite

  • In the Satellite Inspector, drag and drop the planet you wish the satellite to orbit around into the variable target


Check my answer here on Rotate and RotateAround : http://answers.unity3d.com/questions/323032/how-to-rotate-one-object-around-another-one.html

Comment
Add comment · Show 2 · 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
avatar image robertbu · Feb 25, 2013 at 05:58 PM 0
Share

@alucardj: I believe he has the added problem that the satellite was authored with the center point not at the center of the object, so he will have the same issues with these solutions.

avatar image AlucardJay · Feb 26, 2013 at 03:38 AM 0
Share

Aah thankyou, that explains the confusion in all the comments (now deleted). Anyway, both answers appear educational for future readers. All the best.

avatar image
0

Answer by robertbu · Feb 21, 2013 at 05:56 PM

If I understand you correctly, you want to rotate the satellite around the planet?

  • Make an empty game object and place it at the center of the planet.

  • Position the satellite in orbit and then make it a child of the empty game object by dragging and dropping the satellite onto the empty game object in the Hierarchy view.

  • Rotate the empty game object a little bit each frame.

    function Update() { transform.Rotate(Vector3(0,0,2)); }

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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 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

Related Questions

colliders with touch 0 Answers

whole animation not being played 0 Answers

Show activity indicator in center of screen 0 Answers

ASDAsdASDasdqweqw3edqwdQWDEqwedQWD 3 Answers

accessing a variable from one script in another with Unity 1 Answer


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