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

How would i make a part go to the mouse's position and keep going?

Asked by 5 years ago

I don't remember how to do this, i haven't attempted any scripting in a while so, how would you make a part go where your mouse is then keep going directly where it was.

I know you can use ~~~~~~~~~~~~~~~~~ mouse.Hit.p ~~~~~~~~~~~~~~~~~ but i don't know how i would make it continue going the same path.

1 answer

Log in to vote
0
Answered by
hellmatic 1523 Moderation Voter
5 years ago
Edited 5 years ago

You mean a loop? You could do this by using RunService.RenderStepped:

local RunService = game:GetService("RunService")

local SteppedConnection
SteppedConnection = RunService.RenderStepped:Connect(function()
    -- code here
end)

-- Since RenderStepped is an event, you can cancel it by using RBXScriptConnection:Disconnect()

local function DisconnectSteppedConnection()
    if SteppedConnection then 
        SteppedConnection:Disconnect()
        SteppedConnection = nil
    end
end
0
no like, how would i make the part go forward from where i first put my mouse. ATestAccount420 31 — 5y
Ad

Answer this question