- Home /
Question by
Eddie21uk · Jul 23, 2017 at 09:06 PM ·
2d-platformereffectplatforms
why does my player only some times go under the platform ?
HI, Can any one please help me? When i start my game the player only some times goes under the platform and others the platform will stop the player from moving across it.
void Start () { playerCollider = GameObject.Find ("player").GetComponent (); Physics2D.IgnoreCollision (platformCollider, platformTrigger, true); }
void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.name == "player")
{
Physics2D.IgnoreCollision (platformCollider, playerCollider, true);
}
}
void OnTriggerExit2D(Collider2D other)
{
if (other.gameObject.name == "player")
{
Physics2D.IgnoreCollision (platformCollider, playerCollider, false);
}
}
screen-shot-2017-07-23-at-215215.png
(445.4 kB)
Comment
Answer by Eddie21uk · Jul 26, 2017 at 10:29 AM
found my answer on youtube: (link below if interested
Your answer
Follow this Question
Related Questions
How to make a 2D stairs you can walk by 1 Answer
2D Bouncing Platforms w/o Rigidbody 0 Answers
How can I do such as that effect for my water sprite in Unity? 1 Answer
Changing the Player's parent not affecting movement 0 Answers
Terraria lighting 1 Answer