#Gravity System

59 messages · Page 1 of 1 (latest)

vale blaze
wet sparrow
#

Explain a bit more

vale blaze
#

so it speed up as it goes closer to the planet but doesnt orbit like rotate around it Pancake992#9400

vale blaze
#

a diff game

verbal egret
#

@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

verbal egret
verbal egret
#

Something like distance x -1 + 50 or something like that and put it into the speed

vale blaze
verbal egret
#

Weird

vale blaze
#

easyer to stop and start

#

and always get a constant speed

#

better to get distance

verbal egret
#

Yeah true

#

Could also do custom physics

vale blaze
#

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

vale blaze
oblique leaf
oblique leaf
vale blaze
#

but is it editable

oblique leaf
#

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).

vale blaze
#

to help use vector points

oblique leaf
#

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.

vale blaze
#

scetch

#

so the distance is the speed

#

of origin

oblique leaf
#

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”.

vale blaze
#

image 1

oblique leaf
#

Get Acceleration:

#

I had my Gravitational Constant as 0.01. Higher values means stronger gravity. Same thing with mass.

vale blaze
oblique leaf
vale blaze
#

thanks

oblique leaf
#

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.

vale blaze
oblique leaf
oblique leaf
vale blaze
#

oih

oblique leaf
#

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.

vale blaze
oblique leaf