Both are valid options. But when you should use one method over the other depends:
I will give you a few cases for each method:
Projectile spawn method:
- Use this method when your ‘bullets’ has drop (affected by gravity) - eg: Grenade launcher
- When your fire rate is low - Eg: Racket launcher
- When the ‘bullets’ travel relatively slow - Eg: Rocket launcher
Ray trace method:
- Use this when your bullets are instant hits - very fast moving (simple Sniper)
- When the rate of fire is very high - LMG/Gattler gun -If you try to spawn 1 proecjtile for each bullet, that is a lot of Projectile actors to process. So you should instead do ray-cast.
When you use Ray-trace method, you can spwn some pretty particle effects to visualize the bullet’s trajectory - Use a beam emitter?