Search Unity

What's wrong with my modification script "inaccessible due to its protection level"

Discussion in 'Scripting' started by zadit, Sep 12, 2019.

  1. zadit

    zadit

    Joined:
    Jul 5, 2018
    Posts:
    2
  2. zadit

    zadit

    Joined:
    Jul 5, 2018
    Posts:
    2
  3. WarmedxMints

    WarmedxMints

    Joined:
    Feb 6, 2017
    Posts:
    1,035
    The Update method in the fireHp class is private and not publically accessible.

    The error code tells you that. Although if the class inherits from MonoBehaviour and the component is active, Unity would be calling the method.

    It would be easier for people to help in the future if you post code using code tags (See the pinnned thread in this forum) rather than posting screenshots.