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

Can you help me fix my glitchy script ?

Asked by 9 years ago
player = game.Players.LocalPlayer
mouse = player:GetMouse()
character=player.Character
tool=script.Parent.Parent

tool.Equipped:connect(function()

    mouse.Move:connect(function()

player.Character.Torso.CFrame = CFrame.new( player.Character.Torso.Position,mouse.Hit.p)



end)
end)

Its in a Localscript in handle.

This works, but its kinda glitchy. The problem is that when the Character turns to the mouse it gets unbalenced and usually falls. Can you help me fix this script or tell me how to make a better one ? Thank you !

2 answers

Log in to vote
0
Answered by 9 years ago

There's no issue with the script, but I see what you mean. There's no easy way to solve this, unless you use an advanced algorithm to prevent the mouse from getting near the player.

Can I ask what you plan to use it for?

0
is there any other way to do this ? weirdraidercs35 0 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

Its for a gun that im scripting.

Answer this question