 Noobski Guest |
Quote
|
| 2024-02-11 18:44:10 |
|
I have a cube mesh that I scaled down and made a child node of my player. I added a texture to it and now it’s a transparent health bar over my players head. Problem is I can’t get any script I draw up to work how I want it to or work at all. The player nodes name is “player” so I know his health car should be player.health. Can someone draw up a script or scripted action or behavior, that would attach to the cube mesh acting as my Hpbar to track the players health and to shorten width and inscrease it as the players hp goes up and down? If you could or even give me detailed information on how it would greatly help me.
|
 okeoke Registered User |
Quote
|
| 2024-02-11 21:37:18 |
|
You can update scale property on one of the axis to achieve that.
You know max hp value, you can get current value using "player.health". Divide current value by max value and multiply it by the original scale. Apply scale on one of the axis, fx x. Scale on other 2 stay constant.
|
 Noobski Guest |
Quote
|
| 2024-02-11 22:17:11 |
|
Thank you very much! You the Goat!
|