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

Ways to stop something from moving completely without anchoring?

Asked by 8 years ago

I need to keep my player completely still but I cant just anchor it's torso. Is there any other way to do this?

NOTE: I also can't anchor anything welded to it, so welding a part to the torso and then anchoring wont work.

0
Set their walkspeed, in the humanoid properties, to 0. User#11440 120 — 8y
0
Hold up... You understand welds but not properties of the humanoid? User#11440 120 — 8y
0
Even if the walkspeed is 0 the player can still be flung by other object :/ SHDrivingMeNuts 299 — 8y

3 answers

Log in to vote
2
Answered by 8 years ago

I might consider the use of a BodyPosition then, if you can't anchor Parts. As a simple demonstration:

local p = game.Players.LocalPlayer; --Defines the player (assuming this is in a LocalScript)
local torso = p.Character:findFirstChild("Torso");

function stopPlayer()
    local bp = Instance.new("BodyPosition");
    bp.Position = torso.Position;
    bp.Parent = torso;
end

function releasePlayer()
    local bp = torso:findFirstChild("BodyPosition");
    if bp ~= nil then bp:Destroy() end
end
0
Thank you. SHDrivingMeNuts 299 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

the answer is simple, change the player.character.Humanoid walkspeed to 0.

Log in to vote
0
Answered by
Edenojack 171
8 years ago

You could, as suggested, turn the walkspeed to 0, or alternatively, you could make a small function in the StarterPlayerScript's ControlScript, which will disable the character from moving (Walking,Jumping, ect). One thing to note, is that if you are after a completely still torso, you will need to stop the animations running, as one of the default idle animations has the torso bouncing up and down.

Answer this question