Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago

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

Ad

Answer this question