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 Feb 27, 2015 at 03:43 PM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Nomadx · Feb 25, 2015 at 08:57 PM · physicsgravityphysics2dorbit

How to lock an objects orbiting focal point.

I am helping a friend to develop a small mobile app that can simulate very basic orbiting scenarios with different sized objects. Everything works perfectly except that I would like to somehow lock the 1-2 "planets" in the game world so that their combined center of mass Vector3 is always the center of the screen (or Vector3.zero). How hard would it be to make this work?

Comment
Add comment · Show 4
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 meat5000 ♦ · Feb 27, 2015 at 03:26 AM 0
Share

You want to rotate 2 objects around the world origin?

avatar image Nomadx · Feb 27, 2015 at 03:30 AM 0
Share

I currently have 2 objects that orbit around their common center of mass but their individual masses can be altered which shifts the center of mass.

You can also apply a force to one of the objects which will alter the objects orbit and depending on its mass, will indirectly affect the orbit of the other object.

avatar image meat5000 ♦ · Feb 27, 2015 at 03:51 AM 0
Share

$$anonymous$$issing answer

avatar image meat5000 ♦ · Feb 27, 2015 at 04:11 AM 1
Share

I suggest actually using the gravitational bodies equations and seeing what your simulation runs like. Otherwise rotating things around 0 is pretty much what you've got.

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by Nomadx · Feb 27, 2015 at 03:39 PM

I actually figured it out on my way to work this morning. What I did initially was have both objects apply a force towards the other, based on the others mass. What I did to get it to do what I wanted was have an empty game object in the center of the world called "Center of Mass" and made the object I can manipulate orbit that object, the other object then orbits directly opposite except that it is either closer or further from the Center of Mass depending on the ratio between its mass and the mass of both objects.

Comment
Add comment · Show 3 · 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 meat5000 ♦ · Feb 27, 2015 at 03:40 PM 0
Share

So, what I said then :P

Good job.

avatar image Nomadx · Feb 27, 2015 at 04:17 PM 0
Share

Yup, I gave you a little upvote. Thanks for your help :)

avatar image meat5000 ♦ · Feb 27, 2015 at 04:21 PM 0
Share

No problem. Thanks for the upvote :)

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Jump faster and fall slower 1 Answer

How to make an orbital movement as smoothly as possible? 0 Answers

Smooth transition for RotateAround 1 Answer

calculate the future position of an object in orbit 1 Answer

Unity2D Sonic the Hedgehog Physics help needed! 3 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