Hello, i'm working on an experiment which revolves around gravity and how bodies interact in a vacuum. The thing is, if you don't know, distance makes a big deal with that(As close as you are to a body, the faster you get pulled by it.). So i want to draw a line from a body to another so that i can calculate the size of the line and how strongly the gravity actuates. Help please, thank you.
You wont need to draw a line for this (Unless it's for visual reasons). Just use magnitude.
local BodyA = -- object1 -- local BodyB = -- object2 -- local Distance = (BodyA.Position - BodyB.Position).Magnitude print(Distance)
This will print the distance between two objects, modify it for your own uses. For more information I recommend checking out Roblox Dev Hub