Whenever I make or load an object, the camera teleports to position 0,0,0 before creating the object. I assume it does it before, because I set the object to be created at the camera\'s position and the object is always created at 0,0,0. Here is the code:
int NumSkeletons = 0;
//Create skeleton
void CreateSkeleton()
{
if (NumSkeletons == 0)
{
dbLoadImage( \"Bones.dds\", SkeletonTexture );
dbLoadMesh( \"Bones.x\", SkeletonMesh );
}
dbMakeObject( NumSkeletons + 100, SkeletonMesh, SkeletonTexture );
dbTextureObject( NumSkeletons + 100, SkeletonTexture );
dbScaleObject( NumSkeletons + 100, 180, 180, 180 );
dbPositionObject( NumSkeletons + 100, dbCameraPositionX(), dbGetTerrainGroundHeight( Terrain, dbCameraPositionX ( ),
dbCameraPositionZ ( ) ) , dbCameraPositionZ() );
NumSkeletons++;
}
Sorry about the code being so messy, but I was only making this to test out creating objects on the fly.
Anyway, the function is called when the \'+\' key is pressed during game-play. This teleportation also happens if I try to load an object. I have tried making the object not be created at the camera\'s position to no avail, and I have tried turning collisions off. Anyone know why this is happening? Thanks in advance.