Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would you go about making the tornado damage from Natural Disaster Survival?

If you've ever played natural disaster survival you would know what I was talking about basically the damage spins around the tornado!

1 answer

To simulate gravity in an object, add a BodyForce object inside.

Create a large object you want the gravity to act around.

For a simple model of 1 attractor (assuming all the other objects don’t interact with each other, only with the fixed attractor) the force can be calculated by this:

local G = 6.67408 * 10 ^ -11 -- gravitational constant local massivePart = yourPlanet -- attractor, fixed in space

for _, moonPart in pairs( yourMoons ) do local r = massivePart.CFrame.p - moonPart.CFrame.p local F = G * moonPart:GetMass() * massivePart:GetMass() / r.Magnitude ^ 2 moon.BodyForce.Force = F * r.Unit end

https://devforum.roblox.com/t/how-to-script-orbital-gravity/365997/3

This discussion is preserved as it was. New answers, comments, and votes are closed.