• 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!

3D help with 3D animation

SterrFry

Member
hello, i am a bit new to 3d functions of game maker and i am having trouble with animating my 3D model. i hav a static model for my charcter an 8 frames of a running animation all imported to game maker 8.0 and i want to cycle through all 8 of the models to make it look like hes running when the "W" key is pressed and go back to the static model when he is standing still. could anybody give me an example of how to do that through Game Maker 8.0 GML?
 

SterrFry

Member
Hmm I’m having trouble with arrays, game maker 8 doesn’t seem to recognize “array” at all... is there a place where I can get started with learning about it?
 
Z

zendraw

Guest
arrays are multiple variables in 1 so this is a variable
armor=10;
this is an 1d array
book[0]=3;
book[1]=2;
book[2]=4;
book[3]=5;

this is 2d array
chair[0, 0]=3;
chair[0, 1]=6;
chair[0, 2]=1;

you need 1d array for what you want.
 

SterrFry

Member
arrays are multiple variables in 1 so this is a variable
armor=10;
this is an 1d array
book[0]=3;
book[1]=2;
book[2]=4;
book[3]=5;

this is 2d array
chair[0, 0]=3;
chair[0, 1]=6;
chair[0, 2]=1;

you need 1d array for what you want.
Hmm so if I’m understanding this correctly I want to make 8 animation variables (animation 1-8 for each model I’ve made) and put under the create event something like

animation[0] = (code for model1)
animation[1] = (code for model2)

and so on and then under the draw event put something like

Draw (animation[0]) and then set an alarm that when it goes off it then draws animation[1] and so on down the line of animations I made?
 
Z

zendraw

Guest
you need a variable that represents the current animation
so in draw event

draw (animation[current])

and you set "current" to the animation you want to play in the step event.
 

SterrFry

Member
So have current=(my animation, which I have defined in the create event)
And instead of setting alarms in the draw event have “draw(animation[current])” and setting the alarms in the step event?
 

SterrFry

Member
you need a variable that represents the current animation
so in draw event

draw (animation[current])

and you set "current" to the animation you want to play in the step event.
So have current=(my animation, which I have defined in the create event)
And instead of setting alarms in the draw event have “draw(animation[current])” and setting the alarms in the step event?

Sorry for the double reply I’m not familiar with these forums
 
Z

zendraw

Guest
current only tells you which animation you are on, its a pointer, its not the animation itself.
 

SterrFry

Member
Hmm okay that seems to make sense now, I’ll try than when I get home. Thank you so much, you’ve been very helpful!
 
Top