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

play audisource on touch

Discussion in 'Audio & Video' started by cafat, Mar 11, 2017.

  1. cafat

    cafat

    Joined:
    Dec 29, 2016
    Posts:
    1
    i'm new to unity i did some research but i couldn't find anything :(
    i have a 2d android game try to make and i would like to play sound when i touch on a character?
    how can i do that?
     
  2. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If you find the code that will let you do *something* when a touch happens, just add:

    Code (csharp):
    1.  
    2. this.audio.Play();
    3.