Advertisement
1m1m0

Blackhole [Electron Cloud Behavior]

Jan 1st, 2024
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. local function ApplyGravity(object)
  2.     local direction = hole.Position - object.Position
  3.     local gravitationalConstant = gravitationalConstantValue and gravitationalConstantValue.Value or 1000
  4.  
  5.     local force = direction.Unit * gravitationalConstant
  6.  
  7.     local bodyForce = object:FindFirstChild("BlackHoleBodyForce")
  8.     if not bodyForce then
  9.         bodyForce = Instance.new("BodyForce")
  10.         bodyForce.Name = "BlackHoleBodyForce"
  11.         bodyForce.Force = force
  12.         bodyForce.Parent = object
  13.     else
  14.         bodyForce.Force = force
  15.     end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement