My ball is jumping on a 3d cylinder, and sometimes the ball gets stuck inside the cylinder. The ball has a rigid body and it's continuously dynamic. The circle also has a mesh collider. Here is the code to make the ball jump:
void Update () {
if(Mathf.Sign(rg.velocity.y)==-1){
isforceApplied=true;
}
}
void OnCollisionEnter(Collision collisionInfo)
{
if(isforceApplied==true){
isforceApplied=false;
rg.AddForce(transform.up*forceAmount,ForceMode.Impulse);
}
}