Damaging platform with timer over time + character can get damage when stepping on it

Hello people,

I am trying to prototype some mechanics for a level and I am having some troubles to set up a platform( right now just a square tile) which would inflict damage. This platform wether the player character would be stepping on it or not, would be always activated, giving damage in cycle during 2 seconds (random time reference) and then would be deactivated during again same amount of time and so on and so on. For the player feedback, a particle effect would do the trick, being triggered while the giving damage is activated. The platform(s) ideally would start the(ir) cycle when the player cross a trigger volume (call in level blueprint).

I am building everything on top of the recreation of the third person template from scratch.

The platform itself it a basic static mesh, ground 400 by 400 with 2 collision box. One blocking everything for the player to step on it and the other one to give damage each 2 sec. Ig the player walk during this 2 second he would get damage. If not, he is safe.

So far, I tried to make the platform give damage and it worked. I created a function inside the blueprint that gives damage to the character. However, I had some trouble to set up the timing damage system meaning: IsPlayerOverlapping when platform giving damage is inflicting some? I dont know if a platform can give damage without anything overlapping or interacting with it?

I was also trying to set a “IsPlayerInside” bool as false in the construction script of the blueprint to later check with a branch for the player to receive damage if overlapping when platform is giving. if not player is safe. Not really sure how to do that though.

I heard about the “pain causing volume” that could work but I dont know how to include them inside a Blueprint?

Any help to get me started would be appreciated, right now I feel like starting over as I am kinda lost in the process. If someone has any example to guide me or a step by step process to show, I would be grateful. I have little experience with unreal4 and trying to get more. (Also, I am not a programmer).

Thank you very much

:slight_smile:

Al

Hello again,

My help request was not very successful but I ll show what I have got so far. I had to stop working for a while but just got back on it. So my issue are:

  1. how to inflict damage regardless of a collision with a character?
    1b. Launch the whole system trap from the level blueprint trigger (i know for overlap but can’t manage to launch the function inside the blueprints).
  2. My timer to call the function is not really working. Trying to figure that out. Platform should switch on and off with 2 seconds intervals.
  3. In the level blueprint, I am using a custom even to call the blueprint. Don’t know if its the best way to do what I would like to do.
  4. I created two function one to inflict damage and one to stop making damage. Got a health system with basic HUD and float. Again, I am trying, not sure if this is the best way do achieve what I intended.

Any help is welcome!

Here some screnshots