I have a box collision set up on an enemy AI character so that when it over laps with the main player he loses 10% of his health. However it only does it once and to lose more health the player needs to walk outside the box collision and back in again. What I’m trying to do is have the player constantly lose health while he is inside the box collision.
This is the blueprint for the player health.
and this is the blueprint of the AI attack.
I guess I am trying to get a way for that blueprint to loop the damage.
OnComponentBeginOverlap is fired one time when you overlap the box. You have to set a bool to true when the overlap begin and to false when it stop after that you have to check the bool stats with the Event Tick and add your substract heal function.
You can use a Sequence node to add more than one functionality to something. It will do things in sequence, from top to bottom. That will get you more room out of the Event Tick. I would personally not use Tick, though. I would use a Set Timer and put the damaging stuff into a function, set your interval and let the logic do its thing.
I’ll be honest I’ve been working with unreal for a few months now but only game logic for the last two weeks. Before that I only copied blueprints that I saw in youtube videos without really paying attention to what they mean but two weeks ago I realized that without learning and trying to create my own BP’s I’ll end up going nowhere. It’s starting to make a bit of sense now but I still have a long way to go yet. Yggdrasil give me a month and I’m sure I’ll understand the second part of your post but for now over my head sadly. What I did do is put a delay on the output node of the set health and looped it back into the cast game character which acts very randomly. I will press play one time and it will work perfectly and the next play it won’t work at all. Its very weird. I’m sure I’m trying to do something that shouldn’t be done but its not breaking the game. The only thing is it only works 1 out of 4 times.
It didn’t work. I tried a combination of things with it also like put it between casttogamecharacter and set health. I also attached other actor in the box collision to object in the timer as well as game character to the object but nothing worked.
Ok for the life of me I couldn’t figure out what you mean by “Then put what you want to happen.” So I tried to guess based on the graph you posted but none of them worked. Can you tell me where I’m going wrong?
I know but I have already set up my HUD for this type of damage. I don’t want to have to redo it all again for a new type of damage system. There must be a way of looping the damage I have set up. Anyone?
The guy that posted the video tutorial to set up this health system has been asked numerous times how to do this, take constant damage but he has purposely ignored those questions and answered newer questions which leads me to believe that he already knows that with this type of player health its not possible to take constant damage. If he had just acknowledged this then it would have saved my weeks of work. I’ve tied so many other systems into this health setup, I’m now going to have to scrape it all and start from scratch.
I’ve watched some of his videos…and while his methods DO work as intended in his tutorials…it’s not always the most efficient, or sensible thing to do.
The way you are damaging the player is “wrong”.
By wrong, we mean that as _cDub has said, there’s already a way for the player to take damage, and it’s very efficient.
And like Devil showed you…that’s another way you could do it…but just like anything in Blueprints, there’s different ways to achieve something, you have to find out the way that it most efficient and easy for you. But you should be learning the right way…
So, sadly, I would say to forget about his tutorial and start to do it the “easy” way.
So, first off, remember to make sure you spell everything correctly…took me a few seconds to figure out why this wasn’t working;) But here’s the DOT and it works as intended. Taking the dmg I specified off the player’s HP that is set in Character BP.