Hi, I currently have a system set up in my Level Blueprint to count how many times all instances of a class blueprint (Sphere) have collided with the walls in the level. That system loos like this:
The counter is triggered by the “Hit Event” in the class blueprint using an event dispatcher.
This works as I want it to. However, I want to use the variable generated by this to continuously update a float parameter within a Sound Cue. Which again is fine, with this system:
My problem is, I don’t just want the parameter to go up in a linear scale i.e. the more collisions there are the higher the parameter goes. I need it to be continuously monitored, as in constantly updated with how many collisions there were in the last few seconds, so that the parameter can change in real time along with the amount of activity within the level.
But I’m completely stuck! Any advice would be greatly appreciated.
HI, thanks a lot for your response but I’m not sure how this would work. Surely that would just reduce the collision count by 1 every two seconds. What I need need is something that may work in a similar way to a Tick, but every time the tick fires it looks back two seconds from that particular frame and updates the amount of collisions that happened in the two seconds prior to the frame, thus giving a value that is updated on an ongoing frame by frame basis.
I know it’s not possible to do it that way but just trying to find a workaround that will do something similar!
The alternate, and far more complicated, method would be to have an array of times when the event occurred plus (2 seconds.) Sort of like a queue of times. When your event occurs, you queue up the current time plus 2 seconds. On tick, you dequeue the number of times which are less than the current time. The number of events in the last 2 seconds is the size of the queue.