yO_eyDev
(yoeymeme)
June 26, 2021, 5:16pm
#1
So im trying to make a custom movement controller out of the default humanoid, Im thinking of having the player movement made by the Player:Move() feature and I also have a custom AutoRotate that is capable of having the Controls:GetMoveVector() feature. But whenever I disable PlayerModule to make the player not canceling Player:Move(), the Controls:GetMoveVector gets disabled.
How do I disable default movement?
1 Like
Operatik
(Operatik)
June 26, 2021, 5:21pm
#2
Many posts ago, there was this script that used ContextActionService to freeze player movement. Remember to apply this on the client, not server:
local ContextActionService = game:GetService("ContextActionService")
local FREEZE_ACTION = "freezeMovement"
ContextActionService:BindAction(
FREEZE_ACTION,
function()
return Enum.ContextActionResult.Sink
end,
false,
unpack(Enum.PlayerActions:GetEnumItems())
)
-- To unfreeze movement:
ContextActionService:UnbindAction(FREEZE_ACTION)
Original post:
You can use ContextActionService to do this. This disables the PlayerActions and works with both Controller and Keyboard.
Edited to fix per @buildthomas ’s post
local ContextActionService = game:GetService("ContextActionService")
local FREEZE_ACTION = "freezeMovement"
ContextActionService:BindAction(
FREEZE_ACTION,
function() return Enum.ContextActionResult.Sink end,
false,
unpack(Enum.PlayerActions:GetEnumItems())
)
--to unfreeze
ContextActionService:UnbindAction(FREEZE_ACTI…
1 Like
yO_eyDev
(yoeymeme)
June 26, 2021, 5:48pm
#3
I think im gonna look into the Standard 2D Player Controller by Roblox scripts to see if theres any info that can help
yO_eyDev
(yoeymeme)
June 26, 2021, 7:20pm
#4
I just found the solution, just use RunService:BindToRenderStep() or just read the documation on Humanoid:Move() lol