Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How to kill and respawn a player when he collides an enemy ?

Discussion in '2D' started by monsieurmilien, Apr 5, 2020.

  1. monsieurmilien

    monsieurmilien

    Joined:
    Mar 29, 2020
    Posts:
    10
    Hi everybody, during the quarantine I decide with my friend to do a game. It's a game on Unity2D, but I have only one problem. I cannot find the solution on the internet and that why I'm here. I have a collider on my enemy and I want to respawn my player when he touches this collider. Can you help me please ?

    Thanks for your help :D
    Maximilien.


    (BTW I'm french)
     
  2. Aratow

    Aratow

    Joined:
    Nov 4, 2016
    Posts:
    49
    As it is quite a simple and common problem, it would be very unlikely not to find many solutions to that problem on the internet.
    It's great to ask questions! Don't get me wrong. But its essential to develop the skill to research the web, otherwise you might get stuck an awful lot.

    Your english seem quite good so the only concern you should have is asking the right questions or using the right tags for your search. ie; respawn player unity / respawn on collision

    As for your problem, I'm far from advising other people on how to do things if I haven't tested the logic myself, so I can only redirect you to thse:
    https://answers.unity.com/questions/22069/trigger-respawn-after-collision.html
    https://answers.unity.com/questions/1013141/player-respawn-script.html
    youtube

    Bon courage!
     
    Last edited: May 24, 2020
  3. monsieurmilien

    monsieurmilien

    Joined:
    Mar 29, 2020
    Posts:
    10
    Merci beaucoup !!