Yea, that would have definitely been a better way of doing it. I have it so that they fly up when their health is below or at 0, so maybe something like spikes, player hitbox, or a fall triggered them to lose their hp.