I need to confirm that the key is pressed down, and then realease and the pressed again. How can I achived that?. The problem seams that I get bouncing. The problem here is that I want that some weapon appears when I get a wiimote button pressed and when I pressed it again it hides the weapon.
As the wiimote in uni wii only have a boolean function, I dont see a way to avoid the bouncing in this kind of action
Input.GetKeyDown(KeyCode.Joystick1Button1)
Input.GetKeyUp(KeyCode.Joystick1Button1)
But, I’m not sure about Wii.
For example a the variable I have is the following:
Movementwii.fromWiimoteB=true the problem is that I cant unbounce the pressed and realeased.
This is the code I have right now
function DidSword(){
CaneHandle=false;
while (CanSword==false){
if (Movementwii.fromWiimoteB!=false)
CanSword =true;
else
CanSword =false;
yield WaitForSeconds(0.5);}
}
function DidNoSword(){
while (CanSword ==true){
if (Movementwii.fromWiimoteB!=false)
CanSword =false;
else
CanSword =true;
yield WaitForSeconds(0.5);}
}
Any help is welcome
FIXED WITH A LITTLE HELP OF MEALY AND MOORE MACHINE