Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

problems to move the character with touch

Discussion in 'Multiplayer' started by ShevenKrask, Feb 28, 2018.

  1. ShevenKrask

    ShevenKrask

    Joined:
    Feb 20, 2017
    Posts:
    4
    I am trying to make an online rpg, and I need the personage to move by touching the buttons of the image, I have to do it from the script because the local player has to detect me, I would like to know how to make a touch detect if what I am touching It is one of the images of the arrows and if it is still tight, thank you.


    this onclick work but bad :S
    upload_2018-2-28_12-47-10.png

    upload_2018-2-28_12-47-54.png
     

    Attached Files:

  2. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    You are probably best of not using click events but rather check each finger and it's position to see if it's within boundary of your button. This is something you can do every frame. Similar to how touch joysticks are done.
     
  3. ShevenKrask

    ShevenKrask

    Joined:
    Feb 20, 2017
    Posts:
    4
    i solved using raycasthit2d :) i only need study of raycast2d , now i can add touches on buttons , habilities , backpack etc etc :D this is all i need for now . TwoTen thanks for answer jeje