Roblox character walking not normally

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    How do i fix the character walking when interact the proximity prompt

  2. What is the issue? Include screenshots / videos if possible!


    the script

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    No

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local on = false
script.Parent.Triggered:Connect(function(player)
	if on == false then
		on = true
		local DefaultWalk = player.Character:FindFirstChild("Humanoid").WalkSpeed
		local DefaultJump = player.Character:FindFirstChild("Humanoid").JumpPower
		player.Character:FindFirstChild("Humanoid").WalkSpeed = 0
		player.Character:FindFirstChild("Humanoid").JumpPower = 0
		task.wait(0.01)
		player.Character:FindFirstChild("HumanoidRootPart").CFrame = script.Parent.Teleport.CFrame
		player.Character:FindFirstChild("HumanoidRootPart").Anchored = true
		
		local TheAnimation = player.Character:FindFirstChild("Humanoid"):LoadAnimation(script.Parent.TheAnimation)
		TheAnimation:Play()
		
		task.wait(6)
		TheAnimation:Stop()
		local AfterTorso = player.Character:FindFirstChild("Torso").CFrame
		player.Character:FindFirstChild("Humanoid").WalkSpeed = DefaultWalk
		player.Character:FindFirstChild("Humanoid").JumpPower = DefaultJump
		player.Character:FindFirstChild("HumanoidRootPart").Anchored = false
		task.wait(0.01)
		player.Character:FindFirstChild("HumanoidRootPart").CFrame = AfterTorso
		on = false
	end
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

I think this is because the HumanoidRootPart is directly positioned. You need to use player.Character:PivotTo(AfterTorso) instead. Also,

player.Character:FindFirstChild("Humanoid").WalkSpeed = DefaultWalk

Using FindFirstChild like this is redundant, since it will error if the object is not there, which is what the method tries to help prevent. Use WaitForChild or index directly: player.Character.Humanoid.WalkSpeed = DefaultWalk instead.

2 Likes

DefaultWalkSpeed = 16 if necessary

I found the cause of this
The animation is the cause of this problem


Thanks for helping me!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.