How Do I Set Up A Basic Blueprint Health System For A Player?
I am currently trying to set up a very basic health system for my player, so that every 0.5 secs (delay) the player's "Health" Int Variable will decrease by 20, (Default Int Value Of The Variable "Health" = 100). When the var "Health" is smaller or equal to (<=) 0, I want the player's bool called "IsDead" to become True and to then print the string "Died."
Please help me!
This is what I have at the moment, and it doesn't work:
asked May 31 '14 at 02:33 PM in Blueprint Scripting
Lewis James Fox
really if you are working with health and damage you shouldnt be checking it in tick as shadowriver is saying. most of the time you use tick for something that needs to be kept tabs of constantly.
Now I know you might be thinking well health needs to be kept tabs of all the time and youre right and wrong in time sense. You only need to know what your health is when something HAPPENS to make it change.
So on this line of thinking you should use the ONTAKEANYDAMAGE to provide you with a check to when your health changes. Also if you are giving health its kinda the same thing.
Heres and example of a simple setup for health
so here you have a simple setup with one variable representing the health AIHEALTH which can be a float or int and whenever damage is detected it checks to see if the health is still above zero otherwise it destroys the actor. Also it applys the damage to the actor by how much damage was received during that event.
answered May 31 '14 at 07:40 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here