Search Unity

Change volume of source with script

Discussion in 'Scripting' started by MG, Jul 5, 2015.

  1. MG

    MG

    Joined:
    Nov 10, 2012
    Posts:
    190
    Hello

    I want a mp3 i want to be played over and over agian.

    But i want the volume to be equal to "Input.acceleration.x". So everytime i move the phone the volume shall increase, and when i stop moving then phone, the volume should be close to 0.

    How do i do that?
     
  2. MG

    MG

    Joined:
    Nov 10, 2012
    Posts:
    190
  3. MG

    MG

    Joined:
    Nov 10, 2012
    Posts:
    190
    Up
     
  4. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148