Announcement

Collapse
No announcement yet.

Making pawn immune to damage

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Making pawn immune to damage

    Hello everyone...

    I'm working on a tower defense game, and I need to make it so my towers (treated as pawns) don't take damage, cause right now they accidentally shoot each other if they are in the way ><...

    I tried adding "bCanBeDamaged = false", to my Pawn.uc default properties but it isn't working. I know it's the right file & place, because I'm setting other things such as collision, and jump height in the same file and it's working fine.

    Any help would be appreciated, thanks.

    #2
    Are they supposed to be destructible at all? If not, try Health=0 or just override the TakeDamage() function in that class to not apply any damage.

    Comment


      #3
      Originally posted by Wormbo View Post
      Are they supposed to be destructible at all? If not, try Health=0 or just override the TakeDamage() function in that class to not apply any damage.
      Over-riding takedamage() worked perfectly. Thanks for the help!

      Setting health to 0 would have worked, except this also makes them so they can't rotate.

      For anyone else looking to do this, add this code to your Pawn.uc file:

      Code:
      function TakeDamage(int Damage, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser)
      {
      }

      Comment

      Working...
      X