Making Unity 2D game. Make enemy collide with player and kill him | Simple UI Unity 2D tutorial

#UnityTutorial #SimpleUnityGame #unityenemykill
Episode 12. This video shows how is it possible to make the player to be killed by enemy with the touch managing collision detection. Also here is shown how a simple user interface components can be added and how to interact with them.

The BEST MECHANICAL KEYBOARD Metoo Zero for the price. I use it. And I must say that it’s perfect!

Consider purchasing my ULTIMATE UDEMY COURSE with great discount

What this video is about and what it can be used for also: unity 2d tutorial,
collision detection, oncollisionenter2d, collision detection unity, collision detection unity 2d game, unity collider, how to destroy gameobject on collision, unity destroy object, unity destroy collider, unity destroy object on collision, unity destroy object collision C#, collide and destroy unity, destroy if collide unity, learn unity fast, unity tutorial, how to make games with unity, unity how to make game, unity how to make 2d game, not as good as brackeys but good as well.


Xem thêm bài viết khác:

45 thoughts on “Making Unity 2D game. Make enemy collide with player and kill him | Simple UI Unity 2D tutorial

  1. I had a problem with Loadscene you can try this
    public void restartScene()
    hope it helps got this from #HazzardGameWorks

  2. how to define the restart button and game over text to the script? i try to put in GameObject and setActive to false but it still appear at the start of the scene

    i used the Brackeys Player movment Script and i just put the code from this tutorial in a other script and added that to my player but my Player dies every time he toutches the ground. i am very frustraitet becos i was so happy that everything worked perfectly but then at the end every thing was for nothing. I hope someone can help me.
    sorry for my bad englisch.

  4. Hi i wanted to know would this still work the same way if I were to collide with a flag and have it say You Win!

  5. For people like me, who followed the tutorial 1 by 1 but the restart button just doesn't want to work:

    replace Scene01 with SampleScene in the restartbutton-script 😉

  6. hey dude can you help my enemies are just going one direction to left or right i cant make them change direction when they collide


  8. If anyone else had trouble getting the restartScene() function to pop up in the On Click component in the button, my problem was that I had selected the RestartButton Script in the On Click section, not the Button Game object itself.

  9. I have done evereything, what is shown in the video, but when I hover over the Button, it doesnt change the color and when I click it, nothing happens. Does anybody know why?

  10. I have done everything in the video it all works except the player controlled character goes through my enemy character therefore not making the script work. For the enemy character i have added a rigidbody2d and a box collider2d. And on the character i do have the same. How can i get the collision to happen?

  11. i used photos as blood (explosion png images), and i have question, what i need to do if i want to effect would repeat once, cuz now its repeating forever, i tryed – "Destroy(blood, 1f);" , but unity says – "Destroying assets is not permitted to avoid data loss.
    If you really want to remove an asset use DestroyImmediate (theObject, true);
    UnityEngine.Object:Destroy(Object, Single)"

  12. It simply saved my college work so I tried several tutorials but none were straightforward or conclusive … You were the only one who could help me, thank you very much

  13. everyone makes these tutorials so god damn difficult… I watched Brackeys before and i don't understand a sh*t of what he was doin but you do it soooo well!! thanks a lot

  14. just wanna say you're doing a great job and you deserve more watchers and views compared to others doing the same thing. most of them just act cooler but wont give you entire codes to understand… so please keep it up!

  15. Hi Alexander! I´m having one problem with my programming… My character will just attack automatically bitting its enemies, so I want it to kill the enemies just by colliding… But when I collide my enemies, the Collision is detected on Debug Log, all fine… but instead of the Enemy, my Character object is destroyed… What am I doing wrong? Thank you! Mauro.

  16. Hi! Is there a way to change the Player animation when it gets hit instead of making it disapear?

  17. Thank you so much for this tutorial, you saved me so much time. Im soooooo happy right now, thank you so much Alexander! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *