The question is why every time I reset the character, the humanoidStateType changes to None, I have completely no idea why this happen, I have read the post and asked ChatGPT already but I still don’t know why this happen. I have provide the things in StarterPlayer, I don’t know will this affect the HumanoidStateType.
(I disabled the CharacterLocalScript and use a new local script to print the humanoidStateType to ensure not the characterLocalScript, then that is why the output line is 10)
As shown in the image, every time I press the play button, the humanoidStateType is Running. When I press reset character, the humanoidStateType is Dead. After respawn, is None
because this is a fighting game, so that some skill I check is the play have the state “Running” to check is the character standing. If the value is None, than I cannot check can the player use the skills
Did you updated the Humanoid variable after the character reset? Humanoid:GetState() return HumanoidStateType.none when the Humanoid got destroyed and is nil, make sure to update the Humanoid at each respawn.
local Character = LocalPlayer.Character
local Humanoid = Character:WaitForChild("Humanoid")
local function UpdateCharacter()
Character = LocalPlayer.Character
Humanoid = Character:WaitForChild("Humanoid")
end
LocalPlayer.CharacterAdded:Connect(UpdateCharacter)