• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

Problem with idle animation for player

Hey, sorry for my bad english. For some reason this line of code makes my players sprite invisible:

if hspeed & vspeed = 0
sprite_assign(obj_player,spr_player_idle);

It should check if the player is standing still, and then play the idle animation. But when you stand still the player will just get invisible and when you start walking you can see him again.

Thank´s for any help
Kaspar
 

HayManMarc

Member
You can't use && that way.

Also, you probably dont need to use sprite_assign. Just change the sprite index...

It needs to be:
Code:
if hspeed == 0 && vspeed == 0
{
sprite_index = spr_player_idle;
}
 
Last edited:
Top