How do i make players attracted to a black hole

I want to Know how you can make players attracted to a black hole (i already made it)

You either use TweenService or BasePart:ApplyImpulse() or boost instances (BodyVelocity, VectorForce, LinearVelocity)

Can you please make me a script, i don’t know how to use those

The easiest I’d say is TweenService

local TweenService = game:GetService("TweenService")

local destination = "BlackHoles Position"
local HumanoidRootPart = "GetHumanoidRootPart"
local TweenTime = 5

local Tween = TweenService:Create(HumanoidRootPart, TweenInfo.new(TweenTime), {Position = destination})
Tween:Play()
1 Like

Easiest, yes.
However, a black hole attracts because of gravity and a custom gravity system can be made more easily with LinearVelocity.
With LinearVelocity it’s also much easier to have physics interactions.

2 Likes

That was actually the second option I’d have suggested

1 Like

as “position” you mean game.workspace.part or the part position

1 Like

part’s positionimagasdase (1)

do i just remove the " and put it

yes, it was just there for reference

immagine

You insert it in a Vector3.new()

local TweenService = game:GetService(“TweenService”)
local part = game.Workspace.BlackholeActivator

local destination = Vector3.new(-4228.601, -175.256, -791.414)
local HumanoidRootPart = “GetHumanoidRootPart”
local TweenTime = 5
part.Touched:Connect(function(hit)
local Tween = TweenService:Create(HumanoidRootPart, TweenInfo.new(TweenTime), {Position = destination})
Tween:Play()
end)

Doesn’t work

…

GetHumanoidRootPart was just a reference (again). You have to get the player’s HumanoidRootPart however you want

The destination variable should hold a Vector3 position, not a string

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.