Комментарии:
Is there a way to expand this Script so it works with multiple planets each with a different gravity?
ОтветитьTo even more improve the system I would suggest dividing forceVector by mass of the target. That way we will get acceleration vector. Right now velocity of the object does not depend on mass -> light objects will give heavy ones same speed as vice versa, which is incorrect
ОтветитьI watched the video and it's great :)
But I have some doubts about the code. Why when the law of universal gravitation is applied, G is used 2 times? How can I preview the orvite? Why are the orvites that are generated not ellipses or circles? And how can I make gravity not weaken so fast? I'm making a game where the size of the earth is about 500 radius units. What happens to me is that when I get the necessary gravity on the surface at a short distance, the force weakens a lot. Thank you :)
Interesting video! I kinda want to do this but I am using java :/
ОтветитьThis helped me so much I do need a gravity simulation for a project but I had no idea how to do it, thank you
Ответитьthis is awesome, thank you. I used this for my 2d space game, however i noticed that when im orbiting a planet with my ship, the ship stays oriented such that it will be pointing towards the top of the screen on both sides of the orbit when I believe/feel that the ship should be pointing down on one side and up on the other side. it should rotate with the planet. I'm not really sure how i can do that, if i should try adding a torque force, or just directly modify the ship's rotation somehow. i know in the real universe there isnt really a "force" doing this but rather "up" itself gets curved so but there must be a way i can 'cheat' and simply rotate the ship.
ОтветитьLOL, Nice 🌏
ОтветитьReally great video!
I've been working on something simiar for a fun a few years ago, where planets have gravity fields and objects are affected by any planet's gravity that is within range of the object. It was a lot simpler though, I just used a lienar falloff between a gravitational min radius, and a max radius, and outside the max radius, no gravity is applied. The planets also had triggers that cover that max radius, this is how I kept track of the planets that affect each object.
I need help with line renderer
How can I draw a line form one point to another and it should be a free flowing drawing like I draw the line by myself and it only connects to the dot , that I want it to connect or else it resets, and if it collides with other line from other origin points it resets
In order to make it more efficient I would replace "Mathf.Pow(distance,2)" to just "distance * distance".
But anyway it's very useful video!
I am attracted to this video.
Ответить