Quote: "dbStopObject
This command will stop the animation in a specified 3D object.
Syntax
void dbStopObject ( int iObject )
Related Information
BASIC3D Commands Menu
Index
"
What you Do though is make a bool variable named
bStopAnimation and set it to
TRUE:
bool bStopAnimation=true;. Put this in the top of your loop.
Everywhere you have PLAY OBJECT (like in your code snip) immediately after do:
bStopAnimation=false;
Then At the bottom of your loop, you you simply use:
if(bStopAnimation){ dbStopObject(YourID); };
Problem gone, and shows a ya a little piece of how the right logic can work FOR you
{
bool bStopAnimation=true;
if ( dbLeftKey ( ) )
{
dbMoveObject ( 1, -0.02 );
dbPlayObject ( 1 );
bStopAnimation=false;
}
if ( dbRightKey ( ) )
{
dbMoveObject ( 1, +0.02 );
dbPlayObject ( 1 );
bStopAnimation=false;
}
if(bStopAnimation){
dbSopObject(1);
};
}
Cheers