playMaker

Author Topic: How to make a sphere rotate another object?  (Read 1724 times)

summerice

  • Playmaker Newbie
  • *
  • Posts: 2
How to make a sphere rotate another object?
« on: March 05, 2014, 04:27:27 AM »
How to make a sphere rotate another object?I want to make a solar system which all the planet rotate the sun,but I don't know how to achieve this.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to make a sphere rotate another object?
« Reply #1 on: March 05, 2014, 11:48:44 PM »
Hi,

 you simply need to create a hierarchy. Attached the planets to the sun and planets will follow the sun position and rotatino movement.

 likely, you will want a slightly more complex set up where you will have an empty gameobject called "Solar System" and the sun will be a child of it, just like like other planets and then rotatin this "solar system" will rotate all its childs.

 if that not enough, cause indeed, each planet has its own speed,  and that their trajectory is not a circle, you should use a path that you define in editor for planets to follow. For this you can use iTween or any other spline asset you will find on the asset store. This way each planet is independant and you can create a correct valid solar system this way.

as for the moon and sattelites, go for this empty gameobject /Childs approach

bye,

 Jean