Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Help with joystick simulation

Discussion in 'Input System' started by JediNizar, Jan 24, 2024.

  1. JediNizar

    JediNizar

    Joined:
    Nov 13, 2016
    Posts:
    111
    Hi Can some1 help me?
    I'm trying to create a sort of RC Controller (with Bluetooth)
    My App sends Serial commands, linked on different buttons, to an ESP32 microcontroller via Bluetooth.
    So far so good.
    What I still need is to control a motor with a joystick. I want to add a joystick control to the APP and when I Push the stick to the left or the right on the app I want the joystick to give me values from -127 to 127 (those are the max motor speed to the left and right)
    This means pushing the joystick to its max to the left I get a value -127, max to the right 127.
    Idle the value should be 0.
    My main problem/struggle is how to get the values between 0 and 127 when pushing to the right for example.

    any help would be great.