Doodle Jump game issue

Hello everyone…

i am working on doodle jump type of game… i stuck at one issue…

Actually i implemented layer based collision so that player pass through the platform. my player is in “player” layer and platforms are in “platform” layer …
When player jumps i am changing its layer and when players velocity get negative then again i change player layer to “platform”

but when player collides with coin i want my player to behave like he should continue to collides with coin which are coming in his way nd force also will be added to the player.

My issue is that player collides with coin only once nd then bcz of force/jump he pass through all the coins coming in his way. I dnt want that.

He should collect all the coins. I dont understand how to solve this issue.

Please help me guys if u have solution of my problem…

Thanks in advance for your support and help.

function Update () 
{
    if(gameScript.gameStarted)
    {
        if(player.gameObject.rigidbody.velocity.y < 0 && player.gameObject.layer == 8)
	{
		player.gameObject.layer = 9;
		ChangeChildLayerToPlatform();
	}
        }
}

function OnTriggerEnter(other : Collider)
{
    if(other.gameObject.tag == "platform" )
{
	if(other.gameObject.name == "Platform(Clone)" || other.gameObject.name=="platformMoving(Clone)" ||  other.gameObject.name == "BasePlatform" || other.gameObject.name == "basePlatform(Clone)")
	{
		player.gameObject.rigidbody.velocity = new Vector3(0, 0, 0);
		player.gameObject.rigidbody.AddRelativeForce(0 , 580 ,0);
		player.gameObject.layer = 8;
		ChangeChildLayerToPlayer();
		//scoreScript.Score+=5;
	}
	else if(other.gameObject.name == "platformObject(Clone)")
	{
		player.gameObject.rigidbody.velocity = new Vector3(0, 0, 0);
		player.gameObject.rigidbody.AddRelativeForce(0 , 2000 ,0);
		player.gameObject.layer = 8;
		ChangeChildLayerToPlayer();
	}	
 }
}

Looking at the amount of force that you are adding to your player, the issue seems to be that physics engine is not able to detect collision between player and your coin object.

One solution to this is to set the Collision Detection of your player to either Continuous or Continuous Dynamic as per the requirements in your game. Refer this Ridigbody documentation for that.

Let us know if it solves your problem. If this still does not solve the issue then you might need to use RayCast to detect the possibility of collsion beforehand and handle it.