Hey all,
I making now a fps game... my idea its to make that a object will follow you.... but not in the same speed..
like its another characater running after you... and when get close it stops...
my code now its
//move all the little spheres towards the player and slide them
float oldx = dbObjectPositionX(1000);
float oldy = dbObjectPositionY(1000);
float oldz = dbObjectPositionZ(1000);
dbPointObject( 1000,dbObjectPositionX(2000),dbObjectPositionY(2000),dbObjectPositionZ(2000) );
dbMoveObject( 1000,0.5 );
float x = dbObjectPositionX(1000);
float y = dbObjectPositionY(1000);
float z = dbObjectPositionZ(1000);
//little spheres collide with all (0)
int collide1 = SC_SphereSlide( 0, oldx,oldy,oldz, x,y,z, littleRadius + 15.0f, 1000 );
if ( collide1 > 0 )
{
dbPositionObject( 1000, SC_GetCollisionSlideX(),SC_GetCollisionSlideY(),SC_GetCollisionSlideZ() );
}
SC_UpdateObject( 1000 );
the 1000 object its the following one( assault trooper)
and the 2000 object its a sphere that follows the camera( after i want ot make it invisible)
dbMakeObjectSphere( 2000,radius*2.0f );
dbPositionObject( 2000,488,0,253 );
SC_SetupObject( 2000,0,1 );
dbSetObjectCollisionOff (2000);
float fHeight = dbGetTerrainGroundHeight ( 1, dbCameraPositionX ( ), dbCameraPositionZ ( ) );
dbPositionObject ( 2000, dbCameraPositionX ( ), fHeight, dbCameraPositionZ ( ) );
Now the problem its that it never stops.... so its enter to the camera xD i need it to stop before it stuck with the camera... like cant continue walking if in the radius