• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Instance create layer animation problem

T

Turrican

Guest
I've a trouble with the animation of an instance create.
I need to use two sprite sheet simultaneously for the walk animation of my character, one for the upper body and one for the lower (legs and feet), so I've create two object and I've used instance create.
First of all "instance create" doesn't exist anymore, so I've used instance create layer
Code:
if (sprite_index != spr_walkvu) sprite_index = spr_walkvu;
    instance_create_layer(x, y, room_last, obj_player_walk_down)
The problem is that: when the istance is created, every frames of the obj_player_walk_down sprite continues to recreate, leaving a wake of all the frames of the sheet. I don't understand why it leave all the frame and not only the one of the animation.
 

Paskaler

Member
I think you need curly braces around thise two statements after the if statement.

Code:
if (sprite_index != spr_walkvu) {
    sprite_index = spr_walkvu;
    instance_create_layer(x, y, room_last, obj_player_walk_down)
}
 
Top