r/unity_tutorials • u/LlamAcademyOfficial • 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!
1
u/LlamAcademyOfficial Jan 31 '23 edited Feb 03 '23
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
Jan 31 '23
is there a difference between spawn and instantiate?
3
u/LlamAcademyOfficial Feb 01 '23
oh yes,
Bullet.Spawnis just sets up the bullet's internals.Instantiateactually creates a new GameObject.1
2
u/jcameron47 Jan 31 '23
Yes please, awesome! 🤘