Search Unity

how can i save the enemy

Discussion in '2D' started by yosso, Oct 17, 2020.

  1. yosso

    yosso

    Joined:
    Sep 27, 2020
    Posts:
    7
    Hi guys i'm a beginner
    1.I don't want to kill enemies in a 2D game.
    2. I want to heal them by shooting.
    3. How can I get them to randomly walk around when they heal?
    Is there a tutorial video about this?
     
  2. ColonelKurt

    ColonelKurt

    Joined:
    Jun 15, 2020
    Posts:
    17
    Hey, man! It depends on the initial code you're using or you want to start from scratch?
     
  3. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,466
    Some beginner tips: Break down everything you are trying to do into chunks.

    If you want to heal enemies instead of shooting, this is simply addition instead of subtraction. So instead of health start at 100 and subtracting 10 each shot, you can start their health at 0 and add 10 each shot, for example. Basically, just look up "how to deal damage" video and then just convert from subtraction to addition.

    For your randomly walk around, just find a video on NPC movement and have it be enabled when they get healed.

    Maybe your best bet to get familiar with coding and everything Unity is to follow a tutorial for a game that is 2D, shooting, and has enemy movement. Then you can apply your specific changes to that framework.