#Gravity System
59 messages · Page 1 of 1 (latest)
Explain a bit more
so it speed up as it goes closer to the planet but doesnt orbit like rotate around it Pancake992#9400
there was another but broke and got taken down but i got some clips
a diff game
@vale blaze get pos of object you’re moving and subtract it from the position of the object you want to follow
Then add velocity in that direction
And do the same for the other one
And for 0g just add velocity at speed 0.33 with a direction of 0, 1, 0
That’s not exactly how this person did this but that should put you on the right track
Also make sure to use vector normalize before wiring this to the velocity
You could use distance for this
Something like distance x -1 + 50 or something like that and put it into the speed
all planets use pistons
Weird
if you try a 0 g velocity you cant add anymore velocity in any other directio its a rr bug
if you keep on addind 1y it cant move any other direction
with the 3 clips of the broken game it used pistons
this is the circits fornow
Are you interested in something like this? I put together a quick demo. Trying to attach a video.
Yes and Does it use pistons
No, it sets the position directly with “Set Position”. It might be possible to rework it as pistons, but this is smooth as-is. https://cdn.discordapp.com/attachments/907325246544154694/1022327483925798952/00435185673eea24d48ca2ac0c677f22.mov
but is it editable
You can modify the circuits however you want, if that’s what you’re asking. Idk exactly what you’re trying to accomplish, but this is just a demo to show how bodies in orbit act. Here are the circuits that power this. The bottom row initializes some stuff when room launches. Above that, there are 3 distinct rows. One for each planet. The “sun” settings are in the top left. Then I have a button to play/pause and change the sun mass (and therefore the attraction of gravity).
so with this could you get 2 points and use distance to get speed
to help use vector points
Not sure 100% what you’re asking, but these circuits allow a moving object to be affected by the gravity of another object.
So it’ll provide the values for where the moving object needs to be.
Yeah, every frame the next point is calculated for where the object should be. So you’d have the current location and the next location. You can get the distance between those points or “speed”.
also can you take a image of the circit board
image 1
Get Acceleration:
I had my Gravitational Constant as 0.01. Higher values means stronger gravity. Same thing with mass.
can you make it an invention because i understand it better
Sure. https://rec.net/invention/1500221915415804166 when placing the invention, I suggest your character be facing Vector direction 1,0,0. The demo will look better because of the “Initial Velocity” values.
thanks
To know which direction 1, 0, 0 is, throw a vector component down. Rotate it (left, right, forward, back) until it’s value is 1, 0, 0. Face the same way the arrow is facing then place invention.
i was playing around with it and it breakes after after afew seconds
Too strong of gravity can cause a slingshot effect, launching it out of the solar system. Bad Initial Velocity can give it a slingshot orbit as well.
it also does the beebing noise
If it slingshots away and gets too far, that’ll happen.
oih
Yeah, “Initial Velocity” value is set when room loads. Otherwise you can force set the velocity with the exec down below. Velocity vector should be about 10% of a normalized vector magnitude to avoid immediate slingshot.
But this is a very close approximation to real world orbits mechanics. It uses the proper formula, but it’s just hard generating a proper orbit. I spent time positioning those planets precisely and coming up with the specific initial velocities.
Btw… “why” initial velocity is important: if there were no initial velocity, then the object would be pulled straight into the sun
Initial velocity is tangential to the sun and gives it its orbit.
since its a demo if there is a full version include gravitational pull from other planets
That would greatly increase CPU heat but it is doable.