Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Raycasts, Explained. See Every Physics "Cast" in Unity Visualized

Discussion in 'Community Learning & Teaching' started by ChrisKurhan, Aug 9, 2022.

  1. ChrisKurhan

    ChrisKurhan

    Joined:
    Dec 28, 2015
    Posts:
    265


    Hey all! Happy #TutorialTuesday!

    Many of us kind of jumped into gamedev without a solid understanding of "casting", like Raycast and Spherecast. In this video I aim to make it really clear how each of the Ray, Sphere, Box, and Capsule casts work, look, behave, and how you can use each one of them to achieve your "casting" goals!

    In this tutorial video you can see the following "casts" visualized:
    1. Raycast
    2. RaycastAll
    3. Spherecast
    4. SpherecastAll
    5. Boxcast
    6. BoxcastAll
    7. Capsulecast
    8. CapsulecastAll

    each with different variations with trigger collision, layer masking, and more!
    With 19 customizable scenarios, you know the full project being available on GitHub will help you better understand how to use each of these fundamental gamedev functions!