Player Blueprint & example Actor Blueprint
Within the Player Plueprint is a simple variable that can range from -1 to 100 (clamp). The sequence you see is being triggered by a Tick Event. As long as no invulnerability is active (there's an item to come that makes you invulnerable to any damage except falling) the health variable will be count up to a max of 100. Except the Health Regeneration is being deactivated of course (usefull little addition). Afterwards it is checking the player health <= 0, if so, an event will be triggered. But that event is actually a matinee (death anim), therefore it needs to be sent to another Blueprint (Map Functions) within the map, that then triggers the matinee using an Event Dispatcher.
Now to drain the health you but only need another Blueprint communicating with your Player Blueprint. Simply use the setup shown in the image above and it'll decrease your health by 5 for every tick (the higher the value, the faster you'll tick down).
Greetings,
Dave
No comments:
Post a Comment