Anchoring the Root Part doesn’t actually freeze the character, at least when they’re on shift-lock. They can face other directions when they’re on shift-lock even if frozen. I can also hear sounds of walking when they’re frozen and still pressing W, A, S, or D. Is there other way to, like, freeze the character without actually anchoring the Root Part? Like, maybe disabling walking?
Humanoid.WalkSpeed
and Humanoid.JumpPower
. to prevent rotation use Humanoid.AutoRotate
.
if you wanted to freeze animations, do something along these lines.
local animations = humanoid:GetPlayingAnimations()
for i,animation in ipairs(animations) do
animation:AdjustSpeed(0)
end
You can disable the player controls with this (works for mobile as well)
local LocalPlayer = game:GetService("Players").LocalPlayer
local Controls = require(LocalPlayer.PlayerScripts.PlayerModule):GetControls()
Controls:Disable() -- disable
Controls:Enable() -- enable
For shift-lock, you can set Humanoid.AutoRotate
to false
i use this to disable the players controls
local Controls = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule")):GetControls()
Controls:Disable()
--or to enable
Controls:Enable()
seems outlandish compared using to simple humanoid properties?
What humanoid properties are you referring to?
Humanoid.AutoRotate
, Humanoid.WalkSpeed
, and Humanoid.JumpPower
Ah, I wrote the second script as an example of how to combat the shift-lock issue OP was having. The first script (in my original post) uses the PlayerControls
module, which automatically disables controls without having to change humanoid values.
EDIT: Correction, @ekuz0diaa’s solution works just fine, AutoRotate solves the shift-lock issue
understandable, i just like using more performant in specific the freeze function for my games.
Updated to new solution, sorry about that