Search Unity

Question Count collision enter?

Discussion in 'Visual Scripting' started by Tinniman, Jul 28, 2023.

  1. Tinniman

    Tinniman

    Joined:
    Dec 14, 2020
    Posts:
    49
    Hi
    I need to count how many hits my enemy takes before sending output. I have all the collision stuff setup so that I get one collision and then particle/remove but need to set counter for all enemies that need more than one hit? How can I set this up?
     
  2. Tinniman

    Tinniman

    Joined:
    Dec 14, 2020
    Posts:
    49
    I am bumping this because I cannot get further in my game before I find this out
     
  3. S2NX7

    S2NX7

    Joined:
    Aug 17, 2021
    Posts:
    40
    cant you just make a variable with how many times its been hit and add 1 to it and then use a if to check its the amount you want if it is trigger something
     
  4. Tinniman

    Tinniman

    Joined:
    Dec 14, 2020
    Posts:
    49
    How do I set a variable for this? Not sure what you mean:)
     
  5. S2NX7

    S2NX7

    Joined:
    Aug 17, 2021
    Posts:
    40
    Sorry i did not see this just every time the collision happens use a get variable this must be a int and then add 1 to it and use set variable to set the same variable you are getting and then use a if to see if it is the number you want