Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question What is the virtual mouse device in the Input Mapping?

Discussion in 'Input System' started by NeonTheCoder, Sep 9, 2021.

  1. NeonTheCoder

    NeonTheCoder

    Joined:
    Feb 1, 2014
    Posts:
    40
    Created a virtual mouse using the unity built in script.
    Created an action called VirtualMouse with the value set to the position Virtual Mouse option.
    Read the input at runtime.... and value is 0, 0.....
    why? How am I supposed to use/change this virtual mouse value if adding a virtual mouse with the built in script does nothing?
     
  2. Check out the samples.
    screenshot.png

    It's easier to discover there (especially the Canvas/Cursor/Virtual Mouse component) than write down the whole thing again. Also the sample shows you how to create the proper actions and how to use them.
     
  3. NeonTheCoder

    NeonTheCoder

    Joined:
    Feb 1, 2014
    Posts:
    40
    Just to clarify, I am using that asset from the sample. Getting the value from the virtual mouse device directly works from the class, however when polling the input system for an action set to virtual mouse position the result is always 0,0.