How to write life variable in text using Health behavior

Hello everybody ,
how do i get this

I am now using Heath behavior and don’t understand how to get text to write in a text object like I could with variables before

There is no way to get the maximum health out. There are no functions for it. You’d have to store that in a separate variable, unfortunately.

So you’d need to do something like :


1 Like

You can add that functionality to the extension you have downloaded though :


Once in the extension editor :

  1. Click on the Health behaviour in the bottom left panel
  2. Click on the 3 dots of the Health function in the right panel. Select copy, then paste.
  3. Click on the 3 dots of the new function, and select rename. Change the name to “MaxHealth”
  4. Change the full name to Maximum Health
  5. Change the description to include the word maximum.
  6. Change the value to Object.Behavior::PropertyMaxHealth()

And I think that should be it.

Then just use the extension like :

thank you very much for your support, I was able to solve it by changing the extension as in the steps you indicated.
now everything is clearer to me, I have only one last question.
i can’t find the entry to subtract life, i am currently using this code but i don’t think it’s the correct way to do it.


There’s a “Damage the object” action for decreasing health, that take the damage amount as a parameter :


these are the only actions I find

And these are what I get :


Can you open the extension in the editor, and confirm you have the Hit function available :


the hit function was there, I solved it by installing the extension all over again and now it appeared among the available actions
Thanks again