Virtual Control - New Unity Input System

dereklam0528

New member
Hello,

I am having problem with implementing Virtual Control with the new Unity Input System. I have it working on keyboard and mouse on editor, and I am want to try the virtual input. I tried with the "On Screen Stick" component that come with the new input system, but no luck.

Is there any documentation about how to make it work?
 
Does the new input system have a virtual input component? The virtual controls included with the controller uses the input manager and not the new input system. If the new input system includes a virtual controls component then you should be able to use that independent of the character controller.
 
Does the new input system have a virtual input component? The virtual controls included with the controller uses the input manager and not the new input system. If the new input system includes a virtual controls component then you should be able to use that independent of the character controller.
This is where I get confused about. The new input system has "On Screen Stick" component that let me assign to the left stick on a gamepad, I (see image below). I also tried with other component "On Screen Button" and hopefully do a jump, but still doesn't work. What can I do?
Screenshot 2021-01-06 at 11.49.50.png
 
I haven't used the new input system's on screen controls but according to this it looks like the component is automatically setup to be able to forward the input to the action. As a test you could try outputting the value of the left stick:

Code:
            var action = m_PlayerInput.currentActionMap.FindAction(name);
            if (action != null) {
                return action.ReadValue<float>();
            }
            return 0.0f;

Where m_PlayerInput is of type UnityEngine.InputSystem.PlayerInput and action is the action that is mapped to your left stick.
 
I haven't used the new input system's on screen controls but according to this it looks like the component is automatically setup to be able to forward the input to the action. As a test you could try outputting the value of the left stick:

Code:
            var action = m_PlayerInput.currentActionMap.FindAction(name);
            if (action != null) {
                return action.ReadValue<float>();
            }
            return 0.0f;

Where m_PlayerInput is of type UnityEngine.InputSystem.PlayerInput and action is the action that is mapped to your left stick.

I can manage do the jump acton, but when I implement the Horizontal axis. It can sometimes do the walking, but not always works. I think it is because there is something keeps on reseting the axis back to 0. I did remove the keyboard button from the Horizontal action, but still no luck.
 
I would post this in the Unity forum to see if they can help - unfortunately I haven't used that aspect so don't know too much. I don't think that you need to make any changes to the integration though.
 
Top