Get time between two triggers?

How would you set up a timer to get the period of time between trigger A activating and trigger B.

So starts count after trigger A is activated and stops count when the player gets to trigger B and outputs it to text file?

Is my BP correct?

Maybe if you “set timer by event” when A is triggered. Loop timer and 1 second.
Make a float variable and add 1 to that variable behind the timer. This will add 1 for each second.
And when B is triggered, clear the timer handle. And get the float variable and print it. it will print the period in seconds.

Can you please show what this looks like as a BP as I don’t understand, I cant connect the set timer event either!

No I can’t get this to work can someone please help!

What is wrong with your first approach? It works just fine.

it needs to do work with more triggers, that works for trigger 1-2, but I need it to work all the way to the time between trigger 23 and trigger 24

franktech PLEASE be kind to an old man who’s tearing his hair out trying to figure this out and show me what this would look like as a bp mate, honestly I’m going nuts

AAAAAAAAAAAAAAAGGGGGGHHHHHHH!!!

What am I doing wrong with this code, why does it refuse to work?

​​​​​​​

Is this correct, and is there an easier way, you’d have thought there’d be some kind of node with a simple start timer here, end it here?

Would appreciate some help guys.otherwise im going to be adding 109 separate values to a “+” node somewhere!

Do you want to keep all the times between triggers or just the current one?

Here is one way to do it:

If you need to save all the times, then just add the macro output to an array.

A MASSIVE THANKS for that!

I need to record all the times, how do I add the output to an array and are both of your blueprints above stored in the level bp?

Yes, they are both in the level bp.
The second pic is just a macro.

To save the times, create an array variable and add the output of the macro to it:

I genuinely cannot thank you enough for this, its very much appreciated

EC, if i may can i just clarify a couple of things, this is my set up, I’m just trying to make sure I’ve followed correctly:

My macro needs a title parameter and the print string doesn’t say “in development” as yours does, I’m using 4.15?

Also have I correctly set the inputs and outputs within the macro correctly?

I’d really appreciate your advice.

A million thanks again!

This cracked me up…sorry delta I’ve been there but seeing you post your frustration made me feel bonded to you…

I spent about 3 months trying to get a shot gun to work…no one could help or tell me why it wasn’t working…just in a fit one day i put a bush as my bullet and it shot 20 of them. I realized it had zero primitives…
tried something with 1 it worked. Checked the little sphere I was using, something happened on the import… 64 Primitives. Engine Just couldnt spawn 64x20 collisions in one event all in the same general area. Go figure

Know the feeling only too well!

But I’ve been fortunate enough to get someone with sublime programming skills like EC to help with my issue, its guys like EC that are a credit to this forum and without them we’d all be in deep trouble for sure.

Everything looks fine. Did you test it?

I did this in UE4 4.18.2. If you are using a different version, it could explain the “Development Only” and the macro input without a name in mine. In any case, all that is irrelevant and it shouldn’t affect the execution.

It seems to work fine, I REALLY APPRECIATE your help!

EvilCleric, I’ve got the attached, not sure if the arrays correctly setup, would appreciate your input.

I understand its pretty hard to see properly, but I’ve attached an integer variable to a “make array” function, its the only way I could replicate your bp and is probably wrong?