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

How do I make my character follow my mouse?

local speed    = 10   
		local Woosh    = Instance.new("BodyVelocity")
        Woosh.maxForce = Vector3.new(math.huge, math.huge, math.huge)
        Woosh.velocity = CFrame.new(Player.Character.Torso.CFrame, Mouse.Hit).lookVector * speed
        Woosh.Parent   = Player.Character.Torso	

So basically I want my character to slowly make its way to wherever my mouse is pointing kinda like Agar.io but without the circles.

1 answer

✓ Accepted answer

Problem

You want your player to follow your mouse but you are using a Body value, this is extremely ineffcient as you can just use WalkToPoint

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local mouse = player:GetMouse()

while true do
wait()
if mouse.Hit then
player.Character.Humanoid.WalkToPoint = mouse.Hit.p
end
end

1 comment

0

Okay how do I stop it from happening after a certain amount of time

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