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:
Also insted of using Tick use use Begin play and make looped circuit, here you got example, thru more complex then you need it. As you may know you can’t branch action outputs, you need to use sequence to branch it.
really if you are working with health and damage you shouldnt be checking it in tick as 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.
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.
Well that’s easy you are trying to damage the SPAWNPOINT - PLAYERSTART and not the player. If this is a single player game you need to add in a GETPLAYER and then plug that into the damage actor on ApplyDamage
It means you need your character’s reference. If you have set a variable for this I think you could use it. Otherwise I guess the mesh component would work. I’m not sure though, cause Im still pretty new to unreal.