Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Tutorial - Manage Surface Impacts Through Scriptable Objects with This System

Discussion in 'Community Learning & Teaching' started by ChrisKurhan, Apr 5, 2022.

  1. ChrisKurhan

    ChrisKurhan

    Joined:
    Dec 28, 2015
    Posts:
    268


    Hey all! Happy #TutorialTuesday!

    This week is a little more advanced than I typically do. You can learn how to implement a surface management system that centralizes the control of impacts into a single script that is completely configuration driven (via ScriptableObjects). You'll learn how you can use it to create new Surfaces, Impact Types, and even extend more SurfaceEffects than just SpawnObjectEffect and PlayAudioEffect (that's all that's included in this video).

    A common need in video games, to increase immersion of the player, is to add some effect when an impact is made. Using this system whenever an impact is made by any arbitrary action in your game, you can simply call SurfaceManager.Instance.HandleImpact() and this system will utilize Scriptable Objects to determine which effects to play. This allows you to have a highly configuration-driven surface management system where you can reuse effects across different impacts when that makes sense, and easily add/change effects when you want a unique effect!


    As always, the full project is available on GitHub!

    If you got value from this video, please consider liking, subscribing, and sharing to help these tutorials reach and add value to even more people. New tutorials are posted every Tuesday!