Looking for a quick dirty way to subscribe a button to a red flash if answer (button) is wrong.
Currently just checking if the current button pres is right by checking an index in my array, if it’s right then I play a sound and if it’s wrong just play the wrong sound:
button1.onPointerUpObservable.add(function() {
if(button1.textBlock.text == String(arr[currentKey])){
numbers.text = numbers.text + String(arr[currentKey]);
currentKey += 1;
GameSystem.soundSystem.keytone.play();
}
else{
GameSystem.soundSystem.Wrong_Answer.play();
}
});