I am having problems in collision on Y axis. I have a ball on ballY ==100. And the ground is on Y =10. The idea is to stop the ball from falling as soon as it its the ground... So my code is:
//Initially, ground==0;
collide= SC_SphereCastGroup( 1, dbObjectPositionX(9),dbObjectPositionY(9),dbObjectPositionZ(9), dbObjectPositionX(9),bolaY,dbObjectPositionZ(9), 10.0f,0 );
if ( collide > 0 ) {
ballY = SC_GetStaticCollisionY();
ground = 1;
}
else
{
if (ground==0){
ballY = ballY - 5.0f;
}
dbPositionObject( 9,ballX,ballY,ballZ );
SC_UpdateObject( 9);
So do you know why the ball dont stop falling when it hits the ground?