Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Replace Mouse Inputs with Touch Inputs in Bolt

Discussion in 'Visual Scripting' started by bryanmccarthy, Oct 15, 2020.

  1. bryanmccarthy

    bryanmccarthy

    Joined:
    Sep 14, 2017
    Posts:
    1
    I'm trying to replace mouse inputs with touch inputs as I want to make a PC/Mac application work on Android. I tried various ways to replace mouse inputs with touch inputs and I still can't get the application to work on Android. I created the application based on this YouTube tutorial


    Here are two screenshots of the Flow Macros:

    ObjectPicker: https://www.dropbox.com/s/xa6mh1wpikk084y/ObjectPicker (FlowMacro).png?dl=0

    RBMoveOnSurface: https://www.dropbox.com/s/7gqj7yw75ygt7lt/RBMoveOnSurface (FlowMacro).png?dl=0

    What touch inputs will I need to get the app working on Android?

    Thanks!
     
  2. SeaDead

    SeaDead

    Joined:
    Dec 23, 2020
    Posts:
    1
    Same issue here ... And there are plenty of questions regarding this issue, but no answer :(
     
  3. yolostudio

    yolostudio

    Joined:
    Aug 20, 2020
    Posts:
    10
    Hello there,

    You can achieve what you want by following the below steps:
    1. Get mouse position using Input.MousePosition.Get node
    2. Get the world point of the mouse position by using Camera.ScreenToWorldPoint node.
    3. Apply the output of step 2 into your game object transform using Transform.Position.Set node

    I pushed the source into this GitHub repository, you can check it out at Assets/Tutorials/MouseInputMobile.

    Another way to get help is to join our Discord Server then send your tutorial request to #requests channel in BOLT TIPS & TUTORIALS category.

    Here is the ready to use APK file working on Android: https://drive.google.com/file/d/1GjAyjW3BHViTdcRH5YoB6cJX5SRKdAHJ/view?usp=sharing