r/unity_tutorials • • Jan 31 '23

Video Shoot Rigidbody-based bullets with our ScriptableObject-based gun system. They won't pass through walls without collision, and you can still have some hitscan guns too!

61 Upvotes

6 comments sorted by

2

u/jcameron47 Jan 31 '23

Yes please, awesome! 🤘

1

u/LlamAcademyOfficial Jan 31 '23 edited Feb 03 '23

Full Tutorial on YouTube

Hey all 👋! Happy #TutorialTuesday!

This week we'll be upgrading our ScriptableObject-based gun system to support both Hitscan (Raycast) and Projectile (Rigidbody) "bullets"! Some guns just don't make sense to be Hitscan, like a Rocket Launcher. Sometimes you want to have Rigidbody physics so you can more easily have bullet drop and drag.

This week marks part 6 of the ScriptableObject-based Gun Series where we've now implemented most of the common needs for guns. There's still some things like "attachments" and "modifiers" to do, so watch out for those videos coming soon!

👨‍💻 As always, the full project code is available on GitHub!

1

u/[deleted] Jan 31 '23

is there a difference between spawn and instantiate?

3

u/LlamAcademyOfficial Feb 01 '23

oh yes, Bullet.Spawn is just sets up the bullet's internals. Instantiate actually creates a new GameObject.

1

u/[deleted] Feb 01 '23

omg, thank you!