# Platform Cannot move down when player collide buttom of platform Unity?

In my unity game I've arrange different platform ,when my player collide with upper part of the platform so platform falling down but issue that when my player collide to platform buttom of part so platform falling down.

void OnCollisionEnter2D(Collision2D target)
{
if (target.gameObject.tag == "Player") {
gameObject.GetComponent<Rigidbody2D> ().isKinematic = false;
}
}

• so you want your platform to not fall down when the player collides with the bottom part of it ? – Uri Popov Sep 7 '16 at 9:24
• yes....exact this. – Chetan Sep 7 '16 at 9:28
• You may want to look into Platform Effectors – jgallant Sep 7 '16 at 9:57

void OnCollisionEnter2D(Collision2D target)
{
if (target.gameObject.tag == "Player")
{
Vector2 normal = target.contacts[0].normal;
if (normal.y < 0)
{
gameObject.GetComponent<Rigidbody2D>().isKinematic = false;
}
else
{
//Make player pass trough platform if you want this behaviour.
}
}
}


This code should work as you expect it to. I did a rudimentary test with it and it does work. Note this does not allow the player to pass trough the platform if hitting it from the bottom. I have added a comment where you need to implement this.