Raycast vs. Game Object with colider? (Bullet)

Hello, I’m a newbie.

I’m working on a top-down shooting project and researching a ton of tutorials. I’m trying to create a “Helldriver” style and this question just pop into my mind.

I notice that most of them use “Raycast” as the primary way to detect if the target gets hit or not. But I wonder if the “Raycast” thing is more efficient than “a simple game object with a collider” flying through the air as a bullet right?

Thank you.

The main deciding factor for this is typically when you have projectiles that travel at extremely fast speeds, which can cause them to sometimes fly right through a collider without triggering a collision event.

If you use a Rigidbody to move the projectile, then setting its collision detection mode to “continuous” should prevent that from happening, but from my experience, it still seems to occur occasionally, whereas the racyasting method works 100% of the time for me.

The reason this can happen in the first place is because the distance between the projectile’s last & current positions in-between frames will increase the faster it moves, and if that distance is large enough, then it could move from one side of the collider to the other side of the collider without ever touching it, effectively “teleporting” through it:
7930015--1012942--upload_2022-2-27_16-42-15.png

With the addition of a racyast check, you have the projectile perform a raycast from the position it was on the previous frame to the position it is now on the current frame, which will intersect any colliders it may have skipped over, allowing the collision event to occur properly:
7930015--1012948--upload_2022-2-27_16-50-15.png