Using a change in voltage as a trigger in Unity

Supporting Visual Studio on Windows
Post Reply
MemeVega
Fresh meat
Posts: 2
Joined: Fri Sep 27, 2024 4:46 pm
Contact:

Using a change in voltage as a trigger in Unity

Post by MemeVega »

Hi, I'm making a game in unity and I have already managed to get the game to read the phidget bridge, however, I want to know if there is a way to make the player move whenever there is a change in the voltage reader. I'm new to phidgets and I have no idea of all the things that exists inside their library. Can someone please explain me how you're supposed to make it work or a alternative to solve my problem?
User avatar
mparadis
Site Admin
Posts: 660
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Using a change in voltage as a trigger in Unity

Post by mparadis »

You should set up a VoltageRatioChange event handler, this function will trigger whenever the voltage changes. Then you just need your program to look at the value and decide how you want the object to move.

You should take a look at this sample project: Dial Phidget with Unity

This project uses the encoder and digitalInput object instead of VoltageRatioInput, but it should give you an idea of what your program will need to look like in order to control a character with Phidget input that comes from events.
MemeVega
Fresh meat
Posts: 2
Joined: Fri Sep 27, 2024 4:46 pm
Contact:

Re: Using a change in voltage as a trigger in Unity

Post by MemeVega »

Thank you so much for your help. I´ve already done the code and I just need to test it out.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests