Search Unity

Question I want to change variables in different objects

Discussion in 'Getting Started' started by Dreshpack, Apr 4, 2022.

  1. Dreshpack

    Dreshpack

    Joined:
    Aug 28, 2021
    Posts:
    4
    I have a script that is responsible for the health of the monster in one object. And I have a script that is responsible for the spell that deals damage in the button upload_2022-4-4_23-48-18.png
    upload_2022-4-4_23-49-27.png
    Should I use PlayerPrefs to control health because if I add the script that is responsible for the health to SpellButton it doesn't work. Or there is another way to solve this problem? (sorry for my English)