I'm trying to get my model to do its entire animation without me having to hold the key down.. (by just pressing the key once).
Code so far:
if (dbScanCode()==17) { // W
dbMoveObject( 1, .15 );
dbSetObjectSpeed ( 1 , 19 );
dbLoopObject ( 1, 15, 25 );
}
else if (dbScanCode()==31) {
dbMoveObject( 1, -.10 );
dbSetObjectSpeed ( 1, -20 );
dbLoopObject ( 1, 1, 13 );
}
else if (dbScanCode()==57) {
dbLoopObject( 1, 27, 39 );
}
else if (dbScanCode()==2) {
dbSetObjectSpeed ( 1, 20 );
dbLoopObject ( 1, 143, 159 );
}
else {
dbSetObjectSpeed ( 1, 20 );
dbLoopObject ( 1, 89, 109 );
}
The animation for Key=17 (W) works fine as I want the animation to play whilst im holding the key.. But as for Key 57 (Space) and Key 2 (#1) I dont want to hold the key down for the animation to complete. I've tried dbPlayObject.. and it only plays the first frame then stops.
Maybe its a problem with the every so many else if statements.. if so how would I resolve this.. Thanks in advance.