Announcement

Collapse
No announcement yet.

Get variables from instance of class of the same class

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

    Get variables from instance of class of the same class

    Let's say I am making a game that has hundreds of soldiers. Each soldier has a damage value but they aren't all the same.
    How would I send the damage value to the instance of the class directly in front of it so that I can subtract it from its health and deal damage to it without affecting the other soldiers?
    Last edited by roeyb1; 02-12-2015, 08:40 PM.

    #2
    Originally posted by Roey View Post
    Let's say I am making a game that has hundreds of soldiers. Each soldier has a damage value but they aren't all the same.
    How would I send the damage value to the instance of the class directly in front of it so that I can subtract it from its health and deal damage to it without affecting the other soldiers?
    For each loop -> check inside trigger volume -> cast to soldier -> subtract 'health' variable.

    Comment


      #3
      Ok cool thanks, ill try it out when I can

      Comment

      Working...
      X