Original post
Hello everyone, I was wondering if there was any way in Unity to have access to more statistics beyond the live Heart Rate (such as average HR, Max HR, ...) . If so, how can i have access? Otherwise I have to store in an array the whole HRs and calculate the parameters by myself. Thank you in advance! 🙂
Community Member•4/25/2024, 3:34:50 PM
<@120250275477979136> due your last max/min widget implementation- should it be possible to „phrase“ this into unity?
Community Member•4/26/2024, 2:53:36 PM
Sure but I dont think that it should make its way into the plugin - since most of them wont need it.
Better would be writing a class which handles this for all joined IDs (depending if multiplayer or not)
Community Member•4/26/2024, 7:25:34 PM
<@120250275477979136> Okay, i’ll try to manage it. I need just some stats to change my game in real time, it’s single player so just one ID. If you already have some functions to determine the average HR value of the last n minutes or the global average i’d love to have a look at those to take inspiration ✌🏻 thanks to both of you
Community Member•4/26/2024, 7:54:08 PM
<https://gist.github.com/YannickFricke/5ca25b093eca8bca9e54f171fdb64993>
I left out the check for ulong overflow so thats the only thing you need to add
Community Member•4/26/2024, 7:58:03 PM
Its returning -1 since devices can send a heartbeat of 0 - so you dont have an overlap of those values
Community Member•4/26/2024, 8:53:09 PM
Thank you a lot, tomorrow I’ll have a look. 🙏🏻