Soloved
Where some problems with scopes and variables
Hi!
Im trying to implent some collision in my FPS; something that im pretty new to. I searched the forum and found RUCCUS's sliding collision function that I ported to GDK
void SlidingCollision( float x , float y , float z , float nx , float ny , float nz , float radius , int dyn , int obj )
{
// Collision with out excluding any object
int C = SC_SphereSlide( obj , x , y , z , nx , ny , nz , radius , 0 );
dbText( 300 , 300 , dbStr(C) );
if( C > 0 )
{
float cx = SC_GetCollisionSlideX();
float cy = SC_GetCollisionSlideY();
float cz = SC_GetCollisionSlideZ();
dbPositionObject( dyn , cx , cy , cz );
}
}
And here is how I call it
float oldx,oldy,oldz;
oldx = dbObjectPositionX( Clients[ Client ].iObj );
oldy = dbObjectPositionY( Clients[ Client ].iObj );
oldz = dbObjectPositionZ( Clients[ Client ].iObj );
dbMoveObject( Clients[ Client ].iObj , Clients[ Client ].Stats.MoveSpeed );
float newx,newy,newz;
newx = dbObjectPositionX( Clients[ Client ].iObj );
newy = dbObjectPositionY( Clients[ Client ].iObj );
newz = dbObjectPositionZ( Clients[ Client ].iObj );
SlidingCollision( oldx , oldy , oldz , newx , newy , newz , sd_Radius , 1 , 2 );
but it seems to me im doing something cause it wont work
Any help?
Please be nice, I did search the forums but all examples where DBP.
As an example; In Aralox's tutorial he uses ny# and next line is
if ny# = 0 ..
but ny# never gets assigned a value so it will always be 0?
Keep it simple.
Questions? Mail me
