Visualize Raycasts, Paths, and More in the Scene View with Editor Scripting #shorts




Published: 06 Oct 2022

Full Tutorial: https://youtu.be/0q114vTBjB4


Learn how to extend an existing Inspector in the Unity Editor and draw debug information in the Scene View!


In this unity tutorial you will learn how you can start visualizing hard-to-debug information in the Scene View and the Inspector to help you understand exactly what's happening in your script and track down problems fast!


We'll do some simple editor scripting to:

⚫ Show some new controls on the Inspector that toggle on/off the Scene View visualization.

⚫ Show the path and current velocity of a NavMeshAgent in the Scene View

⚫ Show the health of an Enemy in the Scene View

⚫ Show the line of sight raycasts in the Scene View and mark which object is obstructing line of sight.

⚫ Show line of sight information in the Inspector

⚫ Allow clicking in the inspector on an object to ping it in the hierarchy and focus it in the scene view. Optionally with 1 line of code removed you can also select it)


I know it sounds like a lot, but it's actually pretty easy as you'll see in this introduction video


As always, all code from this video is available on GitHub: https://github.com/llamacademy/scene-inspector-debug-information


📚 Resources 📚

⚫ Handles API: https://docs.unity3d.com/ScriptReference/Handles.html

⚫ EditorGUIUtility.GetControlID: https://docs.unity3d.com/ScriptReference/GUIUtility.GetControlID.html

⚫ Custom Editors: https://docs.unity3d.com/Manual/editor-CustomEditors.html

⚫ Editor Windows Not Tied to a Custom Editor: https://docs.unity3d.com/Manual/editor-EditorWindows.html

⚫ AI Series Part 40 (Base for this video): https://youtu.be/dHLNqbKrJdg


📱 Let's stay connected

YouTube: https://youtube.com/c/LlamAcademy

Patreon: https://www.patreon.com/llamacademy

Facebook: https://facebook.com/LlamAcademyOfficial

Twitter: https://twitter.com/TheLlamAcademy

TikTok: https://tiktok.com/@LlamAcademy

Instagram: https://instagram.com/LlamAcademy


----


Believe in LlamAcademy's mission and have received value from the videos? Consider becoming a Patreon supporter: https://www.patreon.com/llamacademy


----

Most tutorials come from knowledge gained making https://survival.llama.software Llama Survival - a top-down zombie survival shooter for Android and iOS.

I also have some Unity Assets: https://assetstore.unity.com/publishers/22409?_aid=1101l9QvC

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


#unitytutorial #tutorialtuesday #gamedev #tutorial #unity #llamacademy #gamedevelopment


Music:

Soft Corporate: Soft Corporate by NewHOfTechnology | https://soundcloud.com/ewfechnolohy

Music promoted by https://www.free-stock-music.com

Creative Commons Attribution 3.0 Unported License

Connect on Social Media

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