Integer to text not working

Here is my blueprint i am using
When I watch the counter variable and the text variable
counter works but the text after conversion is always empty.

Hi Pris0n,

Try doing this instead, see if it makes any difference. Take the wire from your Int + int output and plug it directly into the Text input on the Draw Text. This will automatically create a conversion to text, and shouldn’t alter the value in any way.

Hope that helps!

Ok yes that is an issue. :slight_smile:

First question, can the calculation of the counter go into the HUD blueprint instead? if it only affects the hud display then I would move all of it there.

If it can not you will want to create a public variable in the PlayerController blueprint for the counter, using this blueprint is easiest since you can always access the PlayerController using a Get Player Controller node. Don’t move any of the calculation there, just the variable. Make sure you set the variable to Visible to allow it to be seen from another bp.

With this you should be able to get the variable from both blueprints easily, just drag a wire off of Get Player Controller and type the name of your variable, it should come up. Hook it all back up and it should work properly now.

You can also use the Game State or Game Instance blueprints to store the variable, but any of these should work.

Hmm still doesnt work. Is it a problem that I try to draw the hud in my level blueprint?
If so, how do I get my variable to the HUD blueprint?

Ah thanks. I didn’t know I had to make the variable visible.
My Hud blueprint is called NewHUD2.

Hopefully my last error

You shouldn’t need to do any casting inside your HUD, to set your HUD as the HUD to use, open up your MyGame (GameMode) blueprint and select your HUD from the list. This will set it to be the default HUD shown on screen, and you can remove that cast to HUD node and set the value as you would normally.

Oh ok sorry I was not sure which method you used.

In that case, make sure your Cast To node is the name of your HUD blueprint, like this:

It works correctly for me here, when you drag the blue wire off of Get Hud and are looking for the Cast To node, make sure you have Context Sensitive enabled, there is an issue in version 4.5 that causes it to disappear with that option turned off (fixed in 4.6 though).

The casting is in my level blueprint. So I think I still need it.
NewHUD2 is already the top option in my HUD Class

You’re the man. Thank you :slight_smile: