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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Shoot button using the New UI

Discussion in 'UGUI & TextMesh Pro' started by PradeepKulasekaran, Sep 15, 2014.

  1. PradeepKulasekaran

    PradeepKulasekaran

    Joined:
    Feb 20, 2014
    Posts:
    7
    Hi,

    How to use the New UI for implementing an onscreen shoot button for mobile?

    Do I need to use UI button or Event trigger?

    Is there any sample assets available?
     
  2. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    It depends on what you want. but from the little detail you gave my guess is a UI button would be what you want ("shoot button")
     
  3. PradeepKulasekaran

    PradeepKulasekaran

    Joined:
    Feb 20, 2014
    Posts:
    7
    Ya, I want a on Screen button to shoot when click it. Its for mobile device.
    Say I am enabling isShoot to true if I am pressing it.
    What event should I use?
    OnClick or Event trigger..
    The button shouldnt get spammed if i hold on it.
     
  4. yashaswi

    yashaswi

    Joined:
    Feb 29, 2012
    Posts:
    7
    you need to use event trigger..in event trigger use poinnterUP and pointerDown function..it's simple
     
  5. PradeepKulasekaran

    PradeepKulasekaran

    Joined:
    Feb 20, 2014
    Posts:
    7
    Thanks.. Will that work with multi touch if I have my Joystick on the left hand side?