Support threads, fixes, and FAQs.

How can I use heart rate as a variable?

Last activity: 1/25/2024, 6:29:00 AMJoin the discussion →
Original post
I am developing a Unity project that makes the vibration of the haptic suit different depending on the heart rate. I want to print a log in real time whenever my heart rate changes, what should I do?
Community Member12/4/2023, 2:26:16 PM
Wow this sounds awesome, do not forget to share any progress if you wish 🙂 for dev question there is a perfect person to reach out to <@120250275477979136> 😁😍
Community Member12/4/2023, 2:28:13 PM
Sure, I'll make sure to share the progress 👍
Community Member12/4/2023, 2:29:19 PM
IDK why you ping me since I'm not a Unity dev... <@174193097285173250> Could you help out here?
Community Member12/4/2023, 6:24:53 PM
are you building for the OWO thingy, or a complete different one, im just curious 😉
Community Member12/4/2023, 6:43:10 PM
in the hyperateSocket.cs file, there is an "OnMessage" callback, which on default updates a textbox text every time it receives new data. you can use the same callback for your vibration feature.
Community Member12/5/2023, 12:09:06 PM
Thank you! It's printed out. But I just found a problem... Why is the test version output? I definitely modified the value of the hyperateID variable..
Community Member12/5/2023, 12:09:19 PM
Community Member12/5/2023, 12:09:48 PM
Community Member12/5/2023, 12:26:27 PM
in unity there are 2 ways to edit variables of .cs scripts. one is directly in the code, which provides a "default" value. the second one is in the unity editor, in the object your script is attached to. the value set in the unity editor takes priority over changes in the code. make sure you change the hyperateID in the unity editor, or have set the value there to its default value (the variable name should not be written in BOLD letters)
Community Member12/7/2023, 8:51:35 AM
!!!!! I changed the variable name, and it's solved! I've had the same problem before.. I'm stupid 😅 Thank you so much!!
Community Member1/25/2024, 6:29:00 AM
Hi <@1019257151161638912> can you share your project done for reference? thanks in advance
Cookie preferences