Hello people, I currently have cube “running into me” and I would love to know the least expensive way to make them do damage to me on overlap every X seconds (let’s say 3). If they hug me and I do nothing, they will do dmg every set amount of time.
I tried using the begin overlap but it triggers only once and I have to “leave” the overlap to lose HP again. Do I need to use en EveryTick even? It might be pretty expensive if there are a lot of enemies. I’m not exactly sure how to tackle this.
You have half of it correct, Tick will be expensive and is unnecessary. You can use on begin overlap to set a timer by event. (make sure to check looping and give it the amount of seconds you want between loops.) Also make sure to promote its output timer handle to use for later. Now this timer will call a damaged event every so often. Then off of on end overlap you will simply get that timer handle you promoted and call “clear and invalidate timer by handle”.
Cool, I’m glad you got it working. You are welcome. Could you please mark my answer as correct so that others with a similar question can easily find the solution. Thank you