Hi there, I have BPs that output the distance between two targets. One target is the user’s head/HMD & the other object is the floor. I then get the distance between these two targets & output them as an integer. This way I can get a number which acts as the virtual reality user’s height.
The problem is, I want to also calibrate the user’s max jump height. In other words, I want to know what the max value that the integer outputted during a specific time period is.
At the moment, the integer simply prints a real-time readout of the current distance. How do I output what the “peak” distance is?
Hey there @JakOak! I’ve got a quick little implementation you can use, but I’d definitely tweak it a bit towards your use case. I’ll step through how it works.
I took your basic implementation of the distance function and logic before and left that alone. I skipped the truncate, you can do that at the end if you’d like.
So I made a gate to stop it from polling all the time and two events that open and close it so you can trigger when you want to start polling. So what happens is that the current distance is checked against the current highest listed. If it is higher it sets the highest val variable to it, then prints it. This effectively makes it only print values higher than the last, so while you’re ascending you’ll see a ton of these messages, but when you lower the distance you’ll get none (as the branch will fail and not fire it) even if you’re still recording it.