My ball is jumping on a 3d circle sometimecylinder, and sometimes the ball gets stuck inside the circlecylinder.ball The ball has a rigid body and its continuousit's continuously dynamic and. The circle also havehas a mesh collider. hereHere is my jumpthe code..
void Update () { 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);
}
}