Search Unity

Take damage when touching ground?

Discussion in '2D' started by TheSpookz, Aug 24, 2016.

  1. TheSpookz

    TheSpookz

    Joined:
    Aug 24, 2016
    Posts:
    1
    I wanna add a feature that makes you take damage when touching the ground, but I need help.

    I have a health system already.
    https://gyazo.com/7add55959e6626811df6fea7a66ab4b6

    I added a gyazo link so you guys can see the game, I want to make the player take dmg when touching the bottom ground.

    Anyone able to help me? :D
     
  2. PeaceLaced

    PeaceLaced

    Joined:
    Jun 2, 2015
    Posts:
    53
    Check out this live session @ 49:40. He goes into creating a script that constantly checks right below the characters feet to see if there is ground there. While in this instance he is using it to play an animation, it could easily be adapted to damaging your player.

    Let us know how it goes.
     
  3. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,807
    I think you forgot the link.
     
    PeaceLaced likes this.
  4. PeaceLaced

    PeaceLaced

    Joined:
    Jun 2, 2015
    Posts:
    53