Go.get_scale at init function doesn't get me the correct scale! (SOLVED)

Hello,

I have created a health bar GO for my game enemies (the health bar would follow the characters so using the gui wasn’t an option. I’m using gui for the hero)

I have noticed that go.get_scale() in the init function give me (1,1,1) while the real value is (0.5,0.5,1) which I’m obliged to retrieve it from on_message function when I’m sending the health_bar update… it doesn’t look neat… is it normal? am I missing something?

When you say the real value (0.5, 0.5, 1.0) is that the value which you have typed into editor for that specific game object?

Yes it’s the case. as you can see in the picture I’m pointing to my GO which I modified to fit my character.

The GO originally is (1,1,1). but I modify it when deploying in collection to fit the given situation…

Try to set the scale to be uniform, as in 0.5,0.5,0.5

1 Like

Thanks for the advice. your suggestion somehow helped me to see clearly when debugging.

I was actually using a local variable “local bar_scale” (which is accessible by all other characters in my level)

I should have used self.bar_scale. I need to be more careful.

Problem solved :slight_smile:
Thanks a lot and sorry for the false alarm…

3 Likes