Raycasts in Unity (made easy)

Опубликовано: 08 Май 2025
на канале: Game Dev Beginner
120,654
3.4k

▸ Learn how to CODE in Unity: https://gamedevbeginner.com/how-to-co...

Learn how to use the Raycast function in Unity.

00:00 Intro
00:57 Creating a Ray
02:33 The Raycast Hit variable
03:11 The Raycast function
04:48 Layermasks
07:10 How to exclude Trigger Colliders
08:26 Raycast All
10:03 Raycast Non-Alloc
10:30 Other types of Raycast
13:32 Raycast in 2D
16:00 Outro

You'll learn how to create Rays, how to use Raycast Hit data from collisions when they happen and how all the different types of Raycast function work.

Read my full article here: https://gamedevbeginner.com/raycasts-...

Outro music: New Year by Bad Snacks

Unity icons created by Freepik - https://www.flaticon.com/free-icons/u...
Cursor icons created by Pixel perfect - https://www.flaticon.com/free-icons/c...
Chalkboard image - School rules photo created by kjpargeter: https://www.freepik.com/photos/school...