I have looked all over the place and cant find a way to make a black hole. Im assuming this has something to do with using bodyforce but I also want it to pull in parts. Since I am new to programming I have no idea on how to do this.
Hoping somebody can help!
(also im not sure if this is in the right category. please let me know if its not)
Guessing you also want to know how to apply force when close to the black hole, so here is how I’d do it.
local event = nil
event = game:GetService("RunService").Heartbeat:Connect(function()
local hrp = Humanoid.RootPart
if (hrp.Position-Blackhole.Position).Magnitude<=distance then
local Attachment = Instance.new("Attachment",hrp)
Attachment.Name="BlackholeAttachment"
local AlignPosition = Instance.new("AlignPosition",hrp)
AlignPosition.Name="BlackholeForce"
AlignPosition.PositionAlignmentMode=Enum.PositionAlignmentMode.OneAttachment
AlignPosition.Attachment0=Attachment
AlignPosition.Position=Blackhole.Position
event:Disconnect()
end
end)
Yes, you can use the deprecated BodyPosition instead of the AlignPosition if you really don’t want to create an attachment inside a part. AlignPosition is way better than BodyPosition though. It’s up to you on what you want.