How Do I Make The Player Attack An Enemy Without Getting Damage

Discussion in 'How Can I...?' started by A Yassin, Jan 10, 2022.

  1. A Yassin

    A Yassin Boxer

    Joined:
    Dec 31, 2021
    Messages:
    5
    Likes Received:
    0
    I wanted both the player and the enemy to accumulate damage whenever they attack each other so I used the collide node but how do I make it so the player doesn't get damaged when they're punching. In short, how do I make the attack similar to the one in electrica?

     
  2. Elite Games

    Elite Games Avid Boxer

    Joined:
    Dec 18, 2019
    Messages:
    184
    Likes Received:
    84
    you need to keep track of punching state if your character is in punching state then take no damage else take damage
     

    Attached Files:

  3. A Yassin

    A Yassin Boxer

    Joined:
    Dec 31, 2021
    Messages:
    5
    Likes Received:
    0
    Thanks for the reply but how do I implement that? It'd be easier if it was just code but I don't really get how to implement that using the given nodes. And I can't download the zip file
     
    Last edited: Jan 13, 2022
  4. Bluemusic

    Bluemusic Boxer

    Joined:
    Apr 7, 2020
    Messages:
    59
    Likes Received:
    10
    Use a state machine connected to your if collide. When hit start activate a state that has nothing connected or something else. When the hit end, send the signal back to the state machine to activate if collides.
     
  5. Elite Games

    Elite Games Avid Boxer

    Joined:
    Dec 18, 2019
    Messages:
    184
    Likes Received:
    84
    Can you send me your bbdoc
     

Share This Page