health help

hey all i made a health bar that works fine if the enamy touches u it will take 1 health away tho my problem is that if im right next to it will take life off constantly very fast and what i want is it so it will only take it off summit like every second

Put this setup together very quickly, but it should do what you want:

You’ll need your life property, a toggle for whether you can take damage (Enabled), and a Timer for frequency of hits.

sorry andy can you post a screen of your propertys?

:wink: He doesn’t have to post them. You can figure it out just by looking at which properties he uses.

Life (int) : some integer
Enabled (int) : 1
Timer (timer) : 0 :-? Sorry about the mixup

and of course the property Enemy for the enemy.

Jason Lin

Check if the enemy has an actor bounding box that might be a little too big. Also try setting the pulse mode on.

for some reason for me the enabled when its done once it doesnt go back to true. dont know why tho

[edit] how do i do pulse mode? [/edit]


nevermind fixed it on the timer property it needed to be timer not float

what should i change to make the timer happen more often?

The timer sensor interval.