Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

2 comments

0

no like, how would i make the part go forward from where i first put my mouse.

This discussion is preserved as it was. New answers, comments, and votes are closed.