Game Development Reference
In-Depth Information
2.
Test the movie and make some clicks.
What happened? The projectile passed through the barrier without touching
it. We just experienced tunneling. Now, let's make something to prevent it.
Preventing tunneling - setting bodies as
bullets
As tunneling through static bodies isn't allowed thanks to continuous collision
detection, in some cases we can also enable it on dynamic bodies by setting them
as bullets. A bullet performs continuous collision detection with static and
dynamic bodies.
Remember, you can experience heavy performance issues if you set all bodies to
bullets, so it's up to you to find a compromise between accuracy and performance.
 
Search WWH ::




Custom Search