FIRST PERSON INTERACTION in Unity!

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ก.ย. 2024
  • In this tutorial we'll learn how to make an interaction system for first person games!
    LINKS
    Starter Project:
    github.com/tda...
    Outline asset:
    assetstore.uni...
    Simple Items Pack:
    assetstore.uni...
    Patreon:
    / kabungus

ความคิดเห็น • 22

  • @fernandodasilva-producoesa1023
    @fernandodasilva-producoesa1023 5 หลายเดือนก่อน +2

    Thank you very much for this tutorial, it saved me a lot of time on my final project as the previous tutorial made me having a problem with the outline working only after clicking for the first time in an object

  • @flathippo4997
    @flathippo4997 25 วันที่ผ่านมา

    Great vid! Just wanted to give some feedback; first off the original approach was okay, i would recommend using an IInteractable interface and checking with the component instead of the tag. Also cache that camera!!
    I would also recommend instead of enabling the outline i would add an OnBecameInteractable event and method onto the interface or in your case the class in case i want to do more than just showing/hiding an outline. Same for when its no longer interactable. Just a couple things that came to mind while watching.

  • @JamesOfToya
    @JamesOfToya 5 หลายเดือนก่อน +3

    So... let's say nothing works on my end. What's the procedure?...

  • @md3d519
    @md3d519 3 หลายเดือนก่อน +2

    thanks for this but it would really help to explain the lines of code more thoroughly (just like you did for the if statements), more like explaining the logic behind each line in more of a beginner friendly manner. wish you the best

    • @radiantgames55
      @radiantgames55 2 หลายเดือนก่อน

      Well all he did was first create a script called Interactable (You will need to add this script to every single thing you wish to interact with in the game.) This script also contains a message which you will see when you go near it and a UnityEvent (Here in the inspector you attach the function which you wish to run when someone actually presses the interact button) basically what happens when someone interacts with your interactable. for a light switch you will attach the function which turns on the light.
      Then we create a new script called Player Interaction. This script is responsible for actually interacting with the object. Here we just shoot an imaginary line from the center of our screen (called a ray) and if that line hits the interactable object then we know that this is the object we need to interact with.
      Ofcourse there is more to this but this is the basic outline of the video.
      Let me know if this helps.

  • @sofiansorin3632
    @sofiansorin3632 10 หลายเดือนก่อน +2

    Very nice video man! THX

  • @moshimoshi_04
    @moshimoshi_04 7 หลายเดือนก่อน

    Make more videos like this... I'm gonna support you man....

  • @riner_man
    @riner_man ปีที่แล้ว +2

    You best man, thank you very well

  • @Twani
    @Twani 27 วันที่ผ่านมา

    good work lad

  • @Gsanchezbz
    @Gsanchezbz 6 หลายเดือนก่อน

    There is also a problem, if there is no collider, then the outline will be enabled until you collide with another object that has a collider, for that make sure to place a cube in your camera and place it on top of the raycast. that will solve the problem; xD edit: of course a collider which has another tag to make sure your script has "else{ disableOutline }"

  • @RachelNitsche
    @RachelNitsche 4 หลายเดือนก่อน

    I really liked the Tutorial and therefore I subscribed. Thanks for really great video.

  • @ALTGVIDEO
    @ALTGVIDEO หลายเดือนก่อน

    i love how the links in his description are entirely unusable

  • @wareyl3591
    @wareyl3591 3 หลายเดือนก่อน

    i did the exact same script and doesn't let me change anything in unity :')

  • @fred1541
    @fred1541 4 หลายเดือนก่อน

    Amazing Thanks~

  • @SLRaiden
    @SLRaiden 6 หลายเดือนก่อน

    Good content broo awsome ❤

  • @Whippynoodle1279
    @Whippynoodle1279 2 หลายเดือนก่อน

    can it play a door animation

  • @gottcha0330
    @gottcha0330 5 หลายเดือนก่อน

    is it just me or did he just jinx me with only giving me the interact script then telling me to place another script that "we" aprenetly made

  • @user-th1mt7bn5u
    @user-th1mt7bn5u 4 หลายเดือนก่อน

    Where is Outline script from?

  • @h0f333
    @h0f333 10 หลายเดือนก่อน +2

    hello, may I ask for the project?

  • @AaronNuts_
    @AaronNuts_ 5 หลายเดือนก่อน

    What does the error "The type or namespace name 'interactable' could not be found (are you missing a using directive or an assembly reference?)" mean?

    • @DjSL3ID3R
      @DjSL3ID3R 5 หลายเดือนก่อน

      You renamed or misspelled the script name or the class name (the thing before : MonoBehaviour). In the video the script name is capitalized so maybe check if your Script/Class is called Interactable and not interactable.