Thank you so much!!!! I also commented on Brackey's tutorial "Unity Gravity" using C#, which was very helpful. But this video was the tutorial I have been looking for~~~!!! Because I was hopelessly ineffective at C#, I wanted to script it out using Bolt. It has been a fun journey, however I really appreciated this video to increase my understanding of Bolt. Previously starting out with Bolt with this very project in mind, And seeing if I could solve this without any help, I was able to get the orbits functioning semi-accurately! (I lost days!) Originally, I attempted to simulate gravity and orbits WITHOUT using Rigidbodies, plugging in the actual mass of the sun and earth, and calculating F=MA, and using the gravitational constant, and so forth, but ended up getting in heaps of issues. Apparently, and I could be mistaken, but Bolt doesn't handle very large numbers ... unable to handle exponents 10e+30 or larger? The mass of the sun in kg for example. Bolt offers the variable type of Float, but not Double? So I ran some conversions (into metric tonnes), abstracted the values further, and was able to approximate an orbiting velocity, which was pretty cool! But I scripted together the Bolt blocks in a painfully different way than what you show here. I did so without using lists, methods, or iterating through loops. I used Lots of scene variables and lots of generic math blocks. I cast lots of Floats to Vector 3s, and used the "Transform > Translate" and "Transform > Look at (other objects)" to run the orbital motion. But WHY was it that my planet was spiraling outward, and slowly losing velocity ?? It just confounded me!!! Maybe it was because I hadn't considered "Fixed Update?" Not sure. ANYHOW your tutorial just shows how elegantly this is performed, and much more simply. I have so much appreciation and Genuine gratitude to you for teaching me how to do this! WOW, so Awesome!!!! I'll definitely check out your other videos too. Peace.
9:00 nested for loops would be better because for some objects you're doing the same math twice. for(x from 0-->planetcount){ for(y from x-->planetcount){ calculategravitybetween(x,y) } }
if i wanted to make different planets go around, different speeds etc. Do I have to re-do everything for those objects? i want them to each spin differently, and I have 8 objects, so I rather not build this whole thing everytime. Is there a simpler way to do it?
Gravity should take care of the speed. It's all "physics" based. So the distance to the "sun" or point of orbit partially determines the speed of orbit at least when talking about a circular orbit. If you want to make the objects rotate faster or slower (as a whole) you'll have to change the mass of the object they rotate around.
@@OneWheelStudio Thank you for replying! Yes, that makes sense but if I want different gravity bodies at different speeds. How do I do that? because right now all my gravity bodies rotate together at the same speed but I want them to be different.
@@yasmine1157 You can look up orbital speed and see the variables that effect it (link below), but if you want more control you may want to go away from a physics based model. www.physicsclassroom.com/class/circles/Lesson-4/Mathematics-of-Satellite-Motion#:~:text=The%20orbital%20speed%20can%20be,speed%20of%207780%20m%2Fs.
@@OneWheelStudio yes but this is the only tutorial I can find that shows how to make a solar system using bolt in unity. If there is a less complicated non-physics tutorial that you could point me to, I would really really appreciate it. Because I have not been able to find anything that isn't c# and am much more comfortable and experienced with bolt.
I’m not aware of any. This all really depends on what you are trying to do. If you just want the appearance of orbits but don’t care about physics you could create an empty parent for each planet out the parent at the sun, move the planet out the distance you want it and then rotate the parent.
Ah ok i had misunderstood www.physicsclassroom.com/class/circles/Lesson-3/The-Value-of-g#:~:text=Its%20value%20is%209.8%20m,of%20g%20about%20earth's%20surface.
Thank you for a great tutorial ! I tried to add another child sun to the source game object, but the planet is not reacting to that one - do I need to change anything in the flow machine to include more list items ?
Thanks for your quick reply ! At the moment the flow macro is only attached to the parent gravity source and works for the one child 'sun' - so I thought if I copied it as a second child it would behave the same, since the source would automatically include all the child objects ? Or do I have to do something to the gravity source list ?
The child is m just a visualization. Each flow graph is actually the source of gravity. So just duplicate the sun flow macro and all. Whatever has the gravity source flow macro will act as a source.
Oh, so I have to create a separate source for each attractor ? And they will all be referenced together by the macro ? That makes sense, thank you ! Will keep you posted if I create anything attractive ...
@@OneWheelStudio I fixed it! Not sure where the problem was, I just started from the top and it's working now :) I have since tied the main camera to follow one of the gravity bodies that will act as the player, and set up inputs to apply forces along each axis. I am trying to make a game where you have to slingshot around a few gravity sources to get to a goal trigger as fast as possible. Now that I have the math for gravity between two bodies, I am trying to figure out how I can use that information to draw a line showing the course a gravity body will take at it's current speed and trajectory, and that will update in real time with the players inputs applying small forces for course correction. Thanks for this tutorial - it has inspired me to learn a lot more about both Unity and orbital mechanics!
That sounds like a challenge! Very cool. Would love to see it when you get it going. Might be worth checking out this video on trajectory prediction. ruclips.net/video/4VUmhuhkELk/видео.html
I am doing this tutorial now in 2020, and some things have changed since he filmed this. If you follow each step with a newer unity, it wont work. When you add the graph variables add them as AotList not List rigidbody, it wont work if you do that.
Sorry, not sure what that error is about. Make sure you have the latest version of Bolt. You may need to jump on the Bolt discord - those guys can probably help. I'm using Unity 2019.3.2f1 and Bolt 1.4.11 and am able to create a list of rigidbodies.
I do talk fast. I've gotten better believe it or not. Some folks like the speed others find it challenging... Glad you liked the video even if rarely stop to breathe :)
Breathing is totally overestimated :) but yes, I can use a 0.75x factor to slow down, there is a great ZBrush instructor who is also a super fast talker. Must slow him down, too :)
7:25 V. Interesting. This tutorial and your entire channel are pretty great! Thanks for everything!
Thank you so much!!!! I also commented on Brackey's tutorial "Unity Gravity" using C#, which was very helpful. But this video was the tutorial I have been looking for~~~!!! Because I was hopelessly ineffective at C#, I wanted to script it out using Bolt. It has been a fun journey, however I really appreciated this video to increase my understanding of Bolt. Previously starting out with Bolt with this very project in mind, And seeing if I could solve this without any help, I was able to get the orbits functioning semi-accurately! (I lost days!) Originally, I attempted to simulate gravity and orbits WITHOUT using Rigidbodies, plugging in the actual mass of the sun and earth, and calculating F=MA, and using the gravitational constant, and so forth, but ended up getting in heaps of issues. Apparently, and I could be mistaken, but Bolt doesn't handle very large numbers ... unable to handle exponents 10e+30 or larger? The mass of the sun in kg for example. Bolt offers the variable type of Float, but not Double? So I ran some conversions (into metric tonnes), abstracted the values further, and was able to approximate an orbiting velocity, which was pretty cool! But I scripted together the Bolt blocks in a painfully different way than what you show here. I did so without using lists, methods, or iterating through loops. I used Lots of scene variables and lots of generic math blocks. I cast lots of Floats to Vector 3s, and used the "Transform > Translate" and "Transform > Look at (other objects)" to run the orbital motion. But WHY was it that my planet was spiraling outward, and slowly losing velocity ?? It just confounded me!!! Maybe it was because I hadn't considered "Fixed Update?" Not sure. ANYHOW your tutorial just shows how elegantly this is performed, and much more simply. I have so much appreciation and Genuine gratitude to you for teaching me how to do this! WOW, so Awesome!!!! I'll definitely check out your other videos too. Peace.
9:00 nested for loops would be better because for some objects you're doing the same math twice.
for(x from 0-->planetcount){
for(y from x-->planetcount){
calculategravitybetween(x,y)
}
}
if i wanted to make different planets go around, different speeds etc. Do I have to re-do everything for those objects? i want them to each spin differently, and I have 8 objects, so I rather not build this whole thing everytime. Is there a simpler way to do it?
Gravity should take care of the speed. It's all "physics" based. So the distance to the "sun" or point of orbit partially determines the speed of orbit at least when talking about a circular orbit. If you want to make the objects rotate faster or slower (as a whole) you'll have to change the mass of the object they rotate around.
@@OneWheelStudio Thank you for replying! Yes, that makes sense but if I want different gravity bodies at different speeds. How do I do that? because right now all my gravity bodies rotate together at the same speed but I want them to be different.
@@yasmine1157 You can look up orbital speed and see the variables that effect it (link below), but if you want more control you may want to go away from a physics based model. www.physicsclassroom.com/class/circles/Lesson-4/Mathematics-of-Satellite-Motion#:~:text=The%20orbital%20speed%20can%20be,speed%20of%207780%20m%2Fs.
@@OneWheelStudio yes but this is the only tutorial I can find that shows how to make a solar system using bolt in unity. If there is a less complicated non-physics tutorial that you could point me to, I would really really appreciate it. Because I have not been able to find anything that isn't c# and am much more comfortable and experienced with bolt.
I’m not aware of any. This all really depends on what you are trying to do. If you just want the appearance of orbits but don’t care about physics you could create an empty parent for each planet out the parent at the sun, move the planet out the distance you want it and then rotate the parent.
15:00 the accelerates at the same rate that's what G is
The acceleration of the planet is certainly proportional to G but it is also proportional to the mass of the sun a_planet = G*M_sun/r^2
Ah ok i had misunderstood www.physicsclassroom.com/class/circles/Lesson-3/The-Value-of-g#:~:text=Its%20value%20is%209.8%20m,of%20g%20about%20earth's%20surface.
@@minecraftermad Yeah, the little g is used for acceleration. It's not the best naming and choice of symbols :)
Thank you for a great tutorial ! I tried to add another child sun to the source game object, but the planet is not reacting to that one -
do I need to change anything in the flow machine to include more list items ?
Did you add a "gravity source" flow macro to the child? If not try that. If you did let me know and we can try to debug some more.
Thanks for your quick reply ! At the moment the flow macro is only attached to the parent gravity source and works for the one child 'sun' - so I thought if I copied it as a second child it would behave the same, since the source would automatically include all the child objects ? Or do I have to do something to the gravity source list ?
The child is m just a visualization. Each flow graph is actually the source of gravity. So just duplicate the sun flow macro and all. Whatever has the gravity source flow macro will act as a source.
Oh, so I have to create a separate source for each attractor ? And they will all be referenced together by the macro ? That makes sense, thank you ! Will keep you posted if I create anything attractive ...
I finished the graphs for the Gravity Manager and my planet flys AWAY from the sun instead of towards it... time to check the math again.
Yep. Sounds like a sign error ;)
@@OneWheelStudio I fixed it! Not sure where the problem was, I just started from the top and it's working now :)
I have since tied the main camera to follow one of the gravity bodies that will act as the player, and set up inputs to apply forces along each axis. I am trying to make a game where you have to slingshot around a few gravity sources to get to a goal trigger as fast as possible. Now that I have the math for gravity between two bodies, I am trying to figure out how I can use that information to draw a line showing the course a gravity body will take at it's current speed and trajectory, and that will update in real time with the players inputs applying small forces for course correction.
Thanks for this tutorial - it has inspired me to learn a lot more about both Unity and orbital mechanics!
That sounds like a challenge! Very cool. Would love to see it when you get it going. Might be worth checking out this video on trajectory prediction. ruclips.net/video/4VUmhuhkELk/видео.html
Amazing bro
Faux gravity?
I am doing this tutorial now in 2020, and some things have changed since he filmed this. If you follow each step with a newer unity, it wont work. When you add the graph variables add them as AotList not List rigidbody, it wont work if you do that.
Thanks a lot!!
I did list rigid body and it worked
Устарело. В Bolt (unity 2019.3.0f3) отсутствует List
Sorry, not sure what that error is about. Make sure you have the latest version of Bolt. You may need to jump on the Bolt discord - those guys can probably help. I'm using Unity 2019.3.2f1 and Bolt 1.4.11 and am able to create a list of rigidbodies.
Wow, do you speak fast :o thought on slowing down a little? Besides that a great tutorial, thanks.
I do talk fast. I've gotten better believe it or not. Some folks like the speed others find it challenging... Glad you liked the video even if rarely stop to breathe :)
Breathing is totally overestimated :) but yes, I can use a 0.75x factor to slow down, there is a great ZBrush instructor who is also a super fast talker. Must slow him down, too :)
@@smollismollisworld5655 I am guessing he is Michael Pavlovich? :P
@@jojobee228 :D right on!
@@OneWheelStudio Don't worry, we can pause/restart the video just fine!
Man, u should buy ad for r channel. U r great youtuber, but u have too small views.
Go spread the word! It’s tough to get traction even with ads. Thanks for the encouragement.