thanks to your help the first function worked but only for speeds of two or greater.how do you make it so it runs with a speed of less than 2?
I attempted to make it work like this but i was unsuccessful.
void movecamera(int direction, float speed)
{
int calls;
float x,z,howmany;
float camx = dbCameraPositionX();
float camz = dbCameraPositionZ();
if (speed>=2)
{
x = camx + dbSin(direction) * speed;
z = camz + dbCos(direction) * speed;
}
else if (calls=0)
{
howmany=2/speed;
calls=0;
}
if (howmany>0)
{
calls++;
}
if (calls>=howmany && howmany>0)
{
speed=speed*howmany;
x = camx + dbSin(direction) * speed;
z = camz + dbCos(direction) * speed;
calls=0;
howmany=0;
}
dbPositionCamera ( x, dbCameraPositionY(), z );
}
I think the problem is that calls doesn't equal 0 at the start but i dont know how to only make it equal 0 the first time it is used.