- Home /
Question by
Banging · Oct 25, 2014 at 03:17 PM ·
collision2d
Collision 2d Issues with Sprite
http://i.imgur.com/mq4N0Gm.png http://i.imgur.com/w8MedV7.png
This sprite is supposed to act as my foreground(where the player walks on ) when the foreground tag is given to it upon collision with the player. It fails to flag it the onfloor bool. The script is attached to the bottom square of the player which acts as the collider.
void OnCollisionEnter2D (Collision2D col)
{
if (col.gameObject.tag == "Foreground" || col.gameObject.tag == "Untagged")
{
Player.onfloor = true;
}
}
Comment
The square on the player has a BoxCollider2D right? And not a 3d for instance?
Your answer
Follow this Question
Related Questions
Why does my Rigidbody2D stop moving and stuck when hit 2 colliders at once? 0 Answers
Collision2D only fired on one collider 1 Answer
Collision detection for 2D topdown game 2 Answers
Character on a moving platform slows down 1 Answer
How do I have multiple AI that follow the player but don't move into each other? 1 Answer