So I’m currently working on redoing the movement system for my game with Character Controller / Controller Manager Character Controllers | Documentation - Roblox Creator Hub, the problem is, the player’s character straight up refuses to die.
I looked this up, and some other users have had problems with the Died method calling sometimes, you could try changing it to this:
local healthConnection
healthConnection = humanoid:GetPropertyChangedSignal("Health"):Connect(function()
local health:number = humanoid.Health
if health <= 0 then
controller:Destroy()
healthConnection:Disconnect() -- Now this works
end
end)
This will trigger at any point the health goes at or below zero, and then disconnect automatically.
Since you’re turning off the state machine when using character controller no states are automatically assigned / changed, meaning you’ll have to make your own state machine. Using other signals such as human.HealthChanged or :GetPropertyChangedSignal(“Health”) you can detect when the humanoids health is >= 0 and trigger the .Died signal, either by manually setting it’s state to dead or just firing a function.