Welcome!

Welcome to our community forums, full of great people, ideas and excitement. Please register if you would like to take part.

This is extra text with a test link..

Register Now

Announcement

Collapse
No announcement yet.

My Kill Count script isn't tracking how many Wizards are left

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

  • My Kill Count script isn't tracking how many Wizards are left

    A similar issue I had in Zombie Shooting range. I made a "KillCountScript" that starts at "5" and want it to go down every time each wizard is killed. I also made an empty game object called "KillCount" that I applied the KillCountScript to.
    I added the ChangeScore() line to the WizardHealth script, yet I am unsure if it doesn't work because it shouldn't go there or I am writing it incorrectly. Should I be applying the ChangeScore line to the WizardAI script?
    Thank you for your time!
    Attached Files

  • #2
    I think you're on the right track. The biggest question (since it's not visible here) is do you have a game object named "5"? Specifically, do you have a UIText object named "5" because that's what the script is looking for.

    Comment


    • #3
      I got it! My mistake was naming the "Wizards" text as KillCount under the Canvas, and I had to put my ChangeScore() line under DoDamage when health <= 0 in the WizardHealth script. Thank you for the tip!

      Comment

      Working...
      X