Thanks for the ongoing support on these forums.. I think its great.
I've managed to move my object using dbMouseClick's to a position on a terrain... Managed to loop an animation while its moving aswell. The only trouble I am having is stopping the object once its @ the location. It just keeps on going.. Code:
if(dbMouseClick()==2 && Picked == 10){
TerMousePos = dbPickObject( dbMouseX (), dbMouseY (), 1, 1 );
xHit = dbGetPickVectorX() + dbCameraPositionX();
zHit = dbGetPickVectorZ() + dbCameraPositionZ();
ObjectPlaced = true;
}
if(ObjectPlaced && !ObjectPointed){ //remove !ObjectPointed
dbPointObject( 10, xHit, dbObjectPositionY(10), zHit);
ObjectPointed = true;
}
if(ObjectPlaced && ObjectPointed){
dbMoveObject( 10, 0.16f );
dbSetObjectSpeed( 10, 18 );
dbLoopObject( 10, 1, 13 );
}
if(dbObjectPositionX(10) == xHit && dbObjectPositionZ(10) == zHit){
dbStopObject( 10 );
}
If I remove !ObjectPointed the object will stop at the location but it is indecisive as to which way to point.
Of course all variables are floated.
Thanks in advance.