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?
if health <= 0 then
local hum:Humanoid = humanoid
game.ReplicatedStorage.Events.Remote.PlayerEvents.DeathEvent:FireServer()
hum:ChangeState(Enum.HumanoidStateType.Dead)
end
end)
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