0

I am developing a game in which our player is firing on click. Sometimes during bullet body collision with other dynamic bodies is not coming in contact listener so that bullet body is retain on the screen and not being removed.

Using box2d contact listener I am detecting collisions between dynamic and static bodies.

Problem is not coming with static bodies but problem is coming with dynamic bodies collision and bullet body is not coming in contact listener.

Naveed
  • 24
  • 2
  • If the two dynamic bodies are both moving fast there is no guarantee that they will actually collide during a timestep. From the Box2D manual: "Box2D performs continuous collision sequentially, so bullets may miss fast moving bodies." Are the other dynamic bodies also moving fast, or are they quite small? – iforce2d Apr 05 '12 at 10:01
  • Bullet is moving with linear velocity of 9 and other enemy tank bodies are moving with linear velocity of 3. Enemy bodies are bigger than bullet. – Naveed Apr 06 '12 at 02:46
  • If can find a reproducible case, and step the physics simulation frame by frame you could probably see whether the bullet crosses the tank or not. – iforce2d Apr 06 '12 at 17:29

0 Answers0