How To Interact With Objects [Unity Tutorial]

Поділитися
Вставка
  • Опубліковано 1 сер 2024
  • In this video we're going to take a look at making a generic and reusable script along with a few separate classes to make any of our objects in-game intractable!
    🏡Assets used in this tutorial are the House Interiors and City Street tileset asset packs from Itch by MuchoPixels. find him here:
    muchopixels.itch.io/
    / muchopixels
    Join me and learn your way through the Unity Game Engine, the C# language and the Visual Studio editor. Remember, if this video was useful then DROP A LIKE! 👍
    LEARN MORE ABOUT:
    Extension Methods: • Video
    2D Character Movement: • Retro RPG Style 2D Cha...
    Singletons: • The Beauty of Singleto...
    Inheritance: • Using Inheritance In U...
    💬 Join the Discord community here:
    / discord
    📱 Find us on social media for more Tips and Tricks:
    / comp3interactive
    / comp3interactive
    📱 Play our games for FREE here on Google Play:
    bit.ly/2TisAQo
    ☕ Did I help you out? Feeling generous? Consider buying me a coffee/beer🍺😍: www.buymeacoffee.com/4dpS3yL
    -- CREDITS --
    Intro music courtesy of AudioKorruptBeats, find him here:
    / audiokorruptbeats
    www.beatstars.com/audiokorrup... #UnityTutorial #Unity3D #Comp3interactive #GameDev

КОМЕНТАРІ • 19

  • @tuncozcengel9523
    @tuncozcengel9523 3 роки тому +1

    Hi! Thank you for the super useful information! I am not into coding that much but I could get over my problem with your clear explanation.

  • @zach5334
    @zach5334 3 роки тому +7

    I appreciate this tutorial because you explained every line of code you wrote and taught me so much in only 20 mins.

    • @comp3interactive
      @comp3interactive  3 роки тому +3

      I feel that's where a lot of tutorials on UA-cam fall short, they tell you what to do, but not why you're doing it

  • @dontthinktoomuch7152
    @dontthinktoomuch7152 Рік тому

    Thanks bro been looking for this ❤

  • @radenbagoesyudharanggasanj2542
    @radenbagoesyudharanggasanj2542 3 роки тому

    OMG it's Works like wonder!!!!, Thankyou so much!

  • @LostRelicsOfficial
    @LostRelicsOfficial 3 роки тому +6

    Buen video, Good video :)

  • @zerogames6970
    @zerogames6970 3 роки тому +2

    Hi Comp3 , this is a fantastic video and thankyou for making this. I am getting a slight issue if anyone can assist. When I go to the interactable object, the icon (mouse over icon) only appears on top of one of the objects, then when I move to the second object, the interactable icon will appear above the first object only and not the next one. Hope that makes sense.

  • @alivgalihpratama5126
    @alivgalihpratama5126 2 роки тому +1

    thank you for the tutorial, I appreciate it but.... i have some problem with my script, can you put the openable script to Drive or something so i can download it ?

  • @ratchet22560
    @ratchet22560 2 роки тому +1

    Hello. I'm fairly new to coding. I'm just wondering why you would use abstract class inheritance over an interface? I know that you can only inherit one class where as you can inherit multiple interfaces. Great video by the way, very helpful :)

  • @FarakWarmist
    @FarakWarmist 2 роки тому +1

    Is it possible to use animations instead of SpriteRenderer with this kind of script?

  • @GeneralFatPug
    @GeneralFatPug 3 роки тому

    u r awesome-town my man

  • @SuperNova-uv5ws
    @SuperNova-uv5ws Рік тому +1

    Hello! Good tutorial in terms of pacing and explanations! I do have an issue however...
    I'm getting two errors in the Openable script!
    First one is "no suitable method found to override" and refers to public override void Interactable()
    Second one is "does not implement inherited abstract member 'Interactable.Interact()'" and refers to public class Openable : Interactable
    Now this could totally just be something about the version of Unity I'm using, or whatever, but if anybody knows a solution to this I would greatly appreciate if you'd reply! 💖

  • @sethstigall2484
    @sethstigall2484 3 роки тому +1

    as an american i feel attacked, leave my cans alone! lol loved the video

  • @songsong5494
    @songsong5494 6 місяців тому

    I don't understand what is the purpose of the existence of Reset() method at 8:20 .
    It is not referenced and put into use in any other line n is not a built-in method.

  • @jacklocale9254
    @jacklocale9254 3 роки тому

    I keep getting an error in my "Openable" Script??? It keeps saying that it can't find the script. I thought maybe I mistyped something, or that I missed a semi-colon, but no. There's nothing wrong? I've re-written the script five times and it still isn't working.

  • @marisesuzuki8670
    @marisesuzuki8670 2 роки тому

    14:06 (pls ignore)

  • @evggg
    @evggg 3 роки тому

    You cannot pick up or grab objects with this script. So... not, this is not "extremely" reusable.

    • @Izzy-fr1zu
      @Izzy-fr1zu 2 роки тому +7

      Of course you could also trigger to pickup an Item like this. The raycasting-method just serves as a trigger for other functions. Just because there is no "pickup" method in this video, it doesn't mean, that the raycasting approach doesn't suit the purpose...