I’m using keyboard inputs for character movement in Javascript at the moment.

EXAMPLE:

if(Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow)){move right}

In my swipe script, I have static boolean variables set to false at start and turn true when swipes are detected. Only issue is that they stay true. I need the swipes to act as a key stoke and only be true for one frame.

Any suggestions or ideas? Thank you

EXAMPLE OF WHAT I HAVE TRIED:

PLAYER.js

#pragma strict

static var rightSwipe : boolean = false;

function Update(){ 
    if(Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow) || rightSwipe == true){
     //move right 
  }

SWIPESCRIPT.js

#pragma strict

function Update () { if(swipe was right){ PLAYER.rightSwipe = true; 
    }
}

Related question/same question: http://answers.unity3d.com/questions/807807/need-variable-to-act-as-a-keycode-i-believe-differ.html

SOLUTION FOUND HERE: http://www.reddit.com/r/Unity3D/comments/2j1crf/need_my_swipe_inputs_to_act_as_keyboard_inputs/