Humanoid:Move() moving incorrectly after Anchoring/Unanchoring HumanoidRootPart

Hello,

I have been working on my own player movement script and at one point I have to Anchor the HumanoidRootPart to get a desired effect, and when finished I unanchor the HumanoidRootPart. I am using the Humanoid:Move() function with the relativeToCamera boolean set to true to move the player.

My script works fine up until this point. After Anchoring/Unanchoring the HumanoidRootPart the Humanoid:Move() function starts behaving abnormally by giving the wrong values (Increased values [Speeding up the player], Decreased values [Slowing down the player], and/or just plain wrong direction); however, this only happens when near other objects.

I have already tried the following:

  • Setting HumanoidRootPart.Velocity to 0 before and after Anchoring/Unanchoring respectively.
  • Setting Humanoid.WalkSpeed to 0 while anchored
  • Setting Humanoid.PlatformStand to true before Anchoring and to false after Unanchoring
  • Checking to see if any parts of the Character are beyond the model and colliding with other objects

Humanoid.MoveDirection displays/prints out the same exact Move Directions as it was before Anchoring the HumanoidRootPart, but the character isn’t moving as it was previous to it.

This is the code I am using for Movement

--h = Humanoid
--Hold_W,A,S,D are activated/deactivated on the keyboard presses
runService.RenderStepped:Connect(function()
    if rootPart.Anchored then return end

    local forward = 0
    local sideways=0

    if Hold_W and not Hold_S then
	    forward=-1
    elseif not Hold_W and Hold_S then
	    forward=1
    end
    if Hold_A and not Hold_D then
	    sideways=-1
    elseif not Hold_A and Hold_D then
	    sideways=1
    end

    h:Move(Vector3.new(sideways, 0, forward), true)
end)
1 Like

Are you sure the model is unanchored?

1 Like

Yes, I checked each of the parts and they’re all unanchored

1 Like

Can you provide a copy of the place file or rig? It would help me & others diagnose the problem.

I would; however, it isn’t my project, I’m just trying to resolve an issue with it. And the owner doesn’t want me sending it.

But I can say it uses the R15 character.
And when the anchor takes place an animation is played, the HumanoidRootPart’s CFrame is brought up a few studs and then brought forward a few studs after.
Then the HumanoidRootPart is unanchored

So to fix it I had to preset my characters Humanoid.AutoRotate to false

And then in the script that I used above I manually rotate the character in the RenderStepped event, and the problem went away.
Unsure of why this would affect it, but it did.