Jump to content

short lua snippet :playing animation only one time


holschuh
 Share

Recommended Posts

I don't use lua but heres my c++_ one shot anim code

 

void kill_badguy()

{

if(badguy.frame < badguy.animlength)

{

badguy.model->SetAnimationFrame(badguy.frame,1,badguy.seq);

badguy.frame = badguy.frame + 0.3;

}

if(badguy.frame >= badguy.animlength)

badguy.alive = false;

 

 

}

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

Hi,

 

thx i think there is no short trick to get my which.. i miss the time:getcurrent somewhere and i think if(badguy.frame <(=) badguy.animlength) and the +0.3 stops animation in some cases before the last Animation frame. My try in lua is nearly the same..so i blow my code to get it more robust for different animation length/speet..

 

cu

Volker

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...