Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bullet collides with wall behind player

Discussion in '2D' started by Nathan_D, Jul 6, 2018.

  1. Nathan_D

    Nathan_D

    Joined:
    Oct 10, 2013
    Posts:
    31
    Hi everyone,

    I'm messing around with a 2D/2.5D isometric shooter like Nuclear Throne for practice and my player is having problems shooting while "hugging" a wall. My bullets collide with walls and are destroyed, but when my player shoots downward or to the side while he's touching the wall, the bullet collider touches the wall collider and acts like a collision and destroys itself.

    How do I address this? Would the wall collisions have to read velocity of the bullet? Layering doesn't work because I still want the bullet to collide with other walls, so I'm not sure how to code restrictions on the wall and bullet collision.

    Thanks!