#14 | COLLISIONS AND TRIGGERS IN UNITY 🎮 | Unity For Beginners | Unity Tutorial

Поділитися
Вставка
  • Опубліковано 19 жов 2024

КОМЕНТАРІ • 60

  • @plasteelgaming
    @plasteelgaming 6 місяців тому +8

    These tuturials by Dani Krossing are by far the best ones for beginners on Unity that i have found. They are recent and up to date and while Brackey and others might have been god at one time, they are outdated using a much older version of Unity and too much have changed. I Hope Dani will try and keep this series up to date when unity decide to make changes.

    • @Hidesinmud
      @Hidesinmud 4 місяці тому

      I never realized Brackeys was god once… maybe I need to give that channel a second chance

  • @GlaucoLustosa1
    @GlaucoLustosa1 Рік тому +21

    My friend, you helped me get my first job with JavaScript and now 5 years later I'm here again to learn another tool, thank you I love your content.
    From: 🇧🇷🇧🇷🇧🇷

  • @Sam2fn
    @Sam2fn 5 місяців тому +3

    bro, you can explain so good, that my grandmother that can't speak english would understand. Thx man you are the only one, that explains good, doesn't waste time, explains simple and is smart!

  • @Hidesinmud
    @Hidesinmud 4 місяці тому

    This is where things get really exciting!
    I remember using the map editors for games like Heroes 2 and Warcraft 3, and og Starcraft when I was a kid, and little did I know at that time that using triggered events was the same basic premise as coders were using for all games

  • @OliverJ440
    @OliverJ440 Рік тому +1

    man your a genius i have been looking tutorials for collision detection for so long and i finally found it

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

    Oh gods, if I knew how to put a lot of likes under this video - I would do it.
    A detailed description with several solutions, and explanations for them - this is what I really lacked. It was really helpful.

  • @joeturner3970
    @joeturner3970 3 місяці тому

    I love your explanation. IT is clear and you make it seem so simple. Thanks.

  • @whoopdeefriggindoo
    @whoopdeefriggindoo Місяць тому

    Awesome!
    I'm learning to code c# thanks to you!
    Keep it coming!

  • @cemaliinan5510
    @cemaliinan5510 5 місяців тому +1

    Thank you for this magnificent tutorial Blonde Musk!

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

    Thank you, you made me solve my error that I spent hours on trying to fix

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

    Brilliant tutorial. Thanks a lot. Saved my graduation project.

  • @harshchoudhary1463
    @harshchoudhary1463 2 роки тому +6

    Thanks, you really help me a lot. Btw, how many videos are going to be in this series?

    • @Dani_Krossing
      @Dani_Krossing  2 роки тому +12

      I have no fixed amount planned. I’m just gonna keep on teaching as much as I know. 🙂

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

      @@Dani_Krossing Great news! thanks a lot!

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

    Hi Dani could you please explain how to determine contact points while using OnTriggerEnter2D with GetContact?
    To check if the player collides with the enemy from above and kills the enemy or collides with the enemy from the sides and takes damage instead.
    That would be super helpful! You are a great teacher!

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

      The simplest way would probably just be to compare the x and/or y coordinates of the player and collider when they touch.

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

      @@EnvoyOfFabulousness Yea i got it working after posting this comment :P

  • @chicho5093
    @chicho5093 8 місяців тому +1

    You are great explaining.

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

    Sir make more videos on unity
    I love the way you explain ❤️❤️🤞🤞

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

    Hello, I have a problem, in the OnTriggerStay method, does it allow you to use switch(Collider.gameObject), and different cases?, to act depending on which trigger is pressed.
    Thank you

  • @ThaTrickstaProd
    @ThaTrickstaProd Рік тому +1

    Hi dani, I am having an issue regarding a trigger on an enemy. I put a collision trigger in which the sole purpose is to activate voice lines when the player enters the collision trigger area. The issue is that the collision trigger is activating all other objects such as pickup, doors, and objectives that softlock the game. I received this project from my instructor, so I have little experience with pure game design.
    How can I make it so that the collision trigger only acts for the voice lines and does not trigger anything else? Thank you, and I wish you all the best!

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

    does the colision datatype have to be in the Ontrigger enter function or i can use it outside of it only to check if there is a colision

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

    Great vídeo! I'm working on my first 3D project in Unity right now, just getting to know to engine, and this video helped me understand the "is trigger" option.
    I know this is a little off topic, but, I see that you are using a Blue Yeti to record your voice, and the sound quality is so good. I have one too, and I wonder, do you apply any filters or things like that in the post production?

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

      I apply filters in Adobe Premiere. No matter which mic you use, you should always apply audio filters to get better audio, since the raw sound isn’t that good. 🙂 I have a video on it on my channel under my Premiere playlist.

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

      @@Dani_Krossing oh, thank you so much! I'll watch it!

  • @FP-ih1lu
    @FP-ih1lu 5 місяців тому

    How can I make the bullet pass through objects? My bullet is spawning inside my player, detecting the player, then disappearing.

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

    That's awesome. Maybe you can help me. I cant fix the problem my Player goes through walls.. Can you make A basics Video about Player movement + walls?

  • @BorchikYes
    @BorchikYes Місяць тому

    for some reason whenever I type OnTrigger it doesnt autocomplete and if I type it out myself it doesnt work.

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

    how do I use another game objects trigger for the script. because i want to be able to delete the trigger afterword but i have extra parts to the script so i need to make it split.

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

    Hi Dani - Great tutorial. I have an issue where trigger collider covers up a game object that I want to click on. Is there a way where my gameObject would always have a priority of getting a click event? I tried to put it on different levels but doesn't work. I ended up with hacky solution where if object enters trigger, I make it smaller and on exit, I reset trigger to original size. Any suggestions would be appreciated.

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

      I'm not sure I 100% follow what you are sitting with in your project...
      So you have an object, with a collider component on it, which is set to IsTrigger... Correct? 🙂 And you want it to register, if you click on it?
      I'm not sure I understand the part about "priority"? If you have a collider which is set to IsTrigger, you just write in the code, that you want to register a OnTriggerEnter() event, and then look for a keypress?
      Or are you saying you want something to happen, if you look at the object and do a keypress? Instead of entering the trigger? Which in that case, you have to do a raycast instead of using colliders.

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

    Hey what’s the difference when making a game in mmo and a regular game I been trying to make an mmo game but I don’t know how to start…please help..!!

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

    I need to make a 2d coloring game in unity. There is a painting, colors are available in right side. The task to be done is drag and drop the color into the different sections of the paintings. Please help with it. Make a tutorial video because there is not any available on youtube.

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

    nice video
    :)

  • @Sam4Progress
    @Sam4Progress 7 місяців тому

    So this is how I can talk to girls! kidding of course! But this is very interesting stuff! I was looking for a method to have a continuous Collision or Trigger event that I could control how often it happened within 1 second. Using OnCollisionStay is entirely to much, and there's no way to control it. How would you get a happy middle ground between OnTriggerEnter and OnTriggerStay?

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

    how do i check which side of an object i am touching?

  • @zaqk2
    @zaqk2 3 місяці тому

    You look like Elon Musk... Nice tutorials btw :)

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

    Sir make video on animation,animator,UI and explain its components.
    I get bored when read unity documentation .

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

    Hi, will there be any video about the interface in unity?

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

      I already have one which isn’t part of this playlist 🙂 you can find it in my other Unity playlist

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

      @@Dani_Krossing Oh. awesome I will watch that.

  • @jonathanbrown6616
    @jonathanbrown6616 9 місяців тому

    the trigger wasn't working at all

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

    at some point can we watch how you would make a small game

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

      That’s the plan further down the line. 🙂 There are still some key points I need to touch upon, before I wanna show how to make a small game. For example animations, UI, game structure, etc… But once I have caught us up in my lessons, I will definitely make a video. 😊

  • @bvitytwrbq
    @bvitytwrbq Рік тому +1

    Ball!

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

    bro dont say my ball 😆

  • @mr.someone6205
    @mr.someone6205 2 роки тому

    You look different like almost two different people

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

    Elon musk??

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

      Definitely some musk vibes here 😂

  • @donaldfaulknor2149
    @donaldfaulknor2149 Рік тому +1

    Nope. Wrong. You can't enter a collider if you don't set is Trigger to true. And if you do that, you will go through the ball instead of hitting it.

    • @Dani_Krossing
      @Dani_Krossing  Рік тому +1

      I am not wrong 🙂 you don’t need to set it to trigger for it to work. Just use OnCollisionEnter in your code, instead of OnTriggerEnter.

    • @donaldfaulknor2149
      @donaldfaulknor2149 Рік тому +1

      @@Dani_Krossing Sorry. I was pissed last night after 7 hours of not getting it to work. My player can't enter colliders. They stop before before the border of the collider. I later found out that Character Controllers can't enter colliders, which is not found on the internet. I've searched hundreds of articles and watched 19 videos. NONE of them mention character controllers can't use OnCollisionEnter.

  • @lukakresiski7323
    @lukakresiski7323 4 дні тому +1

    can someone please tell me what is wrong in this line of code or can someone tell me some potencial fixs that could make this code to funcion
    private void OnCollisionEnter2D(Collision2D collision)
    {
    if (collision.gameObject.name == "puščica")
    {
    code(i tested it adn it works9
    }


    }

    • @Dani_Krossing
      @Dani_Krossing  4 дні тому

      I wouldn't use special characters for naming things if I were you. "puščica" is a bit too easy to misspell, and I'm not sure if some Unity features don't support that type of naming.
      Second, you forgot a ) in the following line bellow:
      code(i tested it adn it works9
      Make sure you don't type too fast, and always double check for spelling errors.

    • @lukakresiski7323
      @lukakresiski7323 3 дні тому +1

      @@Dani_Krossing tnx soo much it works now I misspeled a name tnx again