Bouncing Bullets with Hitscan Guns | Unity Tutorial

Описание к видео Bouncing Bullets with Hitscan Guns | Unity Tutorial

Learn how to implement, from scratch, raycast (or "hitscan") bullets, with trails, that can bounce/ricochet off objects!

We'll start off by using some free starter assets from Unity and the New Input System. We'll write a Gun script from scratch that shoots raycast bullets that have a bullet trail / bullet tracer that shows where the bullet is going. Specifically, we're not implementing bullet spread in this video to keep our gun shots accurate to showcase the ricochet behavior. Finally we'll add in the bouncing bullet behavior and get into the demo.

This video has some similarities to what I refer to as "the previous video" where we first implemented Raycast Shooting and Bullet Tracers:    • Hitscan Guns with Bullet Tracers | Ra...  . This time we're fixing some of the issues that were pointed out in the comments and adding new features!

There are 3 key lessons to learn in this tutorial:
⚫ How to implement Raycast bullets that move at a constant speed (improvement over:    • Hitscan Guns with Bullet Tracers | Ra...  )
⚫ What is Vector3.Reflect and how does it work
⚫ How to implement recursive Coroutines

👨‍💻 As always, all code from this video is available on GitHub: https://github.com/llamacademy/raycas...

🏷️Save 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: https://www.jetbrains.com/store/?sect...

📚 Resources
⚫ Vector3.Reflect: https://docs.unity3d.com/ScriptRefere...
⚫ Physics.Raycast: https://docs.unity3d.com/ScriptRefere...
⚫ New Input System: https://docs.unity3d.com/Packages/com...
⚫ Object Pooling for Unity 2021+:    • Unity 2021 Object Pool API - What is ...  

🧡 Believe in LlamAcademy's mission and have received value from the videos? Here's how you can show your support:
🌟 Patreon:   / llamacademy  
🌟 YouTube Member:    / @llamacademy   or click the Join button on any video
📚 Take my Unity ShaderGraph Course:
https://www.gamedev.tv/p/unity-shader...
👕 Get yourself some LlamAcademy merch: https://llamacademy.myspreadshop.com/
💸 Use my Affiliate Link for Humble Bundles https://humblebundleinc.sjv.io/9g4ak4
💸 Publisher Sale! 50% OFF an entire publisher's Assets! Publisher changes weekly! https://assetstore.unity.com/publishe... (affiliate)
💸 Save up to 50% on NEW Assets: https://assetstore.unity.com/?new_sal... (affiliate)

Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.

Chapters:
00:00 Bouncing Bullets Background
01:56 Scene Overview
02:54 Gun.cs - Variables
03:54 Gun.cs - Raycast Shooting
05:58 Gun.cs - Bullet Tracer @ Constant Speed
08:10 Gun.cs - Impact, Vector3.Reflect and Bouncing
11:08 PlayerAction.cs & New Input System Setup
11:33 Setting up the Gun
12:20 Demo & Why Object Pooling is NEEDED

Комментарии

Информация по комментариям в разработке