I am making project in unity 3d -2019.1.9f1 which includes a object(eg. cube) hitting group of objects. When the object is colliding with group of objects, the mesh is getting mixed means the UI of both getting merged.
here is the collision function
void OnCollisionEnter(UnityEngine.Collision collisionInfo)
{
if (collisionInfo.gameObject.tag == “EnemyShape”)
{
Debug.Log(“Collided with enemy shape”);
//movement.enabled = false;
GameManager.gm.showOptions();
if (GameManager.gm.Sound)
{
audioSource.PlayOneShot(OtherShapeCollision);
}
if (GameManager.gm.Vibration)
{
Handheld.Vibrate();
}
if (collisionParticle.isStopped) {
Debug.Log(“Collision particle is stopped, playing it”);
trailParticle.Stop();
collisionParticle.Play();
}
movement.ballSpeed = 0;
movement.camSpeed = 0;
movement.bonusBallSpeed = 0;
}
else if (collisionInfo.gameObject.tag == “FriendShape”)
{
#if UNITY_EDITOR
Debug.Log(“Collided with friend shape”);
#endif
//movement.enabled = false;
if (GameManager.gm.Sound)
{
audioSource.PlayOneShot(SameShapeCollision);
}
}
}
here is the object movement function-
void forwardMovemnent()
{
if (currentObjectDistance < maxObjectDistance && currentObjectDistance > minObjectDistance)
{
rb.velocity = Vector3.forward * ObjectSpeed;
}
else
{
rb.velocity = Vector3.forward * camSpeed;
}
}
Any solution how can i fix this ?