Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - G4L23

Pages: [1]
1
Support / Re: OnCollisionEnter2D and TileMap problem
« on: January 20, 2014, 05:16:09 pm »
And of course it was a stupid mistake ::) I retyped this portion from scratch and completely missed that. Thanks!

2
Support / OnCollisionEnter2D and TileMap problem
« on: January 19, 2014, 08:56:32 pm »
Alright, so I've been converting my project from using 3D colliders to 2D colliders and have run into a strange issue.

I have a basic tilemap painted with a tag called Ground that uses the 2D edge colliders when the game is run. The player character has a 2D rigidbody and a 2D box collider on it, and in the player's script I have the following collision code -

Code: [Select]
void onCollisionEnter2D(Collision2D collision)
{
if(collision.collider.tag == "Ground") _isGrounded = true;
        print("COLLISION DETECTED");
}

void onCollisionExit2D(Collision2D collision)
{
if(collision.collider.tag == "Ground") _isGrounded = false;
}

When the player character collides with the tilemap, it works as expected and I can move the player around with no problem. But no matter what I do it will not detect the collision and change _isGrounded to true or print out any values. I never had a problem getting this working with the 3D colliders...

Am I missing something?

Pages: [1]