P
Pietuuh
Guest
Hi i'm new to GameMaker and I don't understand why this code isn't working. I have sprites sPlayerPunchRight and sPlayerPunchLeft and an object oPlayer. In oPlayer there's a left pressed event that has this code in it.
When i click the left mouse button nothing happens.
Code:
// Punching
WhichPunch = random_range(1,2);
if (WhichPunch == 1) {
sprite_index = sPlayerPunchRight;
}
if (WhichPunch == 2) {
sprite_index = sPlayerPunchLeft;
}