Humanoid.EvaluateStateMachine changing health behaviour

I found out about Humanoid.EvaluateStateMachine when trying to create a movement system with Character Controller, and I just thought it changed the physics and the states of the character: but when I die/reset, the player does not fall apart like it should, Do I have to create an entirely new health system, or is there some way I can circumvent this?

FYI: My code is similar to this guy’s:

How to Actually Use Roblox’s Physics Character Controllers - Resources / Community Tutorials - Developer Forum | Roblox

Thank you!

paste this in your local script:

	if health <= 0 then
		local hum:Humanoid = humanoid
		game.ReplicatedStorage.Events.Remote.PlayerEvents.DeathEvent:FireServer()
		hum:ChangeState(Enum.HumanoidStateType.Dead)
	end
end)
1 Like

create a remote event called “DeathEvent” that fires when the player’s health is 0, then go to the server script and call the remote. under Updatecharacter function do this