# PrintString to ProgressBar

**URL:** <https://forums.unrealengine.com/t/printstring-to-progressbar/412690>\
**Category:** UI\
**Tags:** hud, progress-bar, unreal-engine, print-string, UE4, question, Blueprint\
**Created:** [December 19, 2017, 9:23pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690 "2017-12-19T21:23:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b84f87d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b84f87d1](https://forums.unrealengine.com/u/anonymous_user_3b84f87d1)\
**Post date:** [December 19, 2017, 9:23pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/1 "2017-12-19T21:23:31Z")

</div>

Hi, I’m doing a 2d slidescroller and I did a basic score system: when you pick a coin you score 10 when it arrives to score = 100 it resets to 0 and gives you health. Now I can see the values from print strings but I don’t know how I can see this value on a progress bar. The HUD with the progress bar is actually made and it shows to your screen so it’s working nice. I have seen some tutorials but they didn’t work. Thank you for your help! here are some photos about the score scripting.

 ![224446-coinscript.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/e/01e32187bc312a5c9cf0ea3f89d3dc05e9c77698.png)

 ![224447-coinscript2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/1/c/91c71e1b45d85fcdd3a0c1d83554664aea8806d5.png)

 ![224448-coinhud.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/5/4/5549409c1fbf423a776d914d30ae02ebdb7e3daa.png)

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [December 19, 2017, 9:35pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/2 "2017-12-19T21:35:49Z")

</div>

Hey there, do you want to be able to see a text in front of the progress bar to see the progress like

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/b/acb84a5228e9c43cc02dc97e55c8fc56029826c5.png) ](https://www.wpf-tutorial.com/Images/ArticleImages/1/misc-controls/progressbar_text.png)

?

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [December 19, 2017, 9:51pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/3 "2017-12-19T21:51:58Z")

</div>

Put a Overlay over your Progressbar and add a Text in there. Create a Binding for your Text. Read whatever you want from your Character refference (I assume you already have the Progressbar working). Format the Text however you want and pass it into the return node. Done.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b84f87d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b84f87d1](https://forums.unrealengine.com/u/anonymous_user_3b84f87d1)\
**Post date:** [December 19, 2017, 10:15pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/4 "2017-12-19T22:15:42Z")

</div>

nono I think I explained it bad sorry. I want a progress bar working not a text, I have the script of score working but not the progress bar

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b84f87d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b84f87d1](https://forums.unrealengine.com/u/anonymous_user_3b84f87d1)\
**Post date:** [December 19, 2017, 10:18pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/5 "2017-12-19T22:18:24Z")

</div>

I want only a progress bar. I have the script of the score that is working (+10 every time that you take a coin) and I have that on a print string. But I don’t know how can I script my progress bar. So I only need some help on my progress bar blueprint .

So theres a pict of how it’s working right now (only want my progress bar working) thank you for the feedback you are always helping dude 😃

 ![224473-scoresystem.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/a/6ea828955a0cccd5800bc2f3591cd1cd14f55753.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b84f87d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b84f87d1](https://forums.unrealengine.com/u/anonymous_user_3b84f87d1)\
**Post date:** [December 19, 2017, 10:21pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/6 "2017-12-19T22:21:42Z")

</div>

Here is a photo 😃 (I only want my progress bar be working) thank you 😃

 ![224473-scoresystem.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/a/6ea828955a0cccd5800bc2f3591cd1cd14f55753.jpeg)

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [December 19, 2017, 10:27pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/7 "2017-12-19T22:27:55Z")

</div>

You need to go to the progress bar in UMG and create a bind function for the progress value. The return value needs to be a value between 0.0 to 1.0, so you need to get your current number of coins and divide it with the maximum (which is 100).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b84f87d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b84f87d1](https://forums.unrealengine.com/u/anonymous_user_3b84f87d1)\
**Post date:** [December 19, 2017, 10:33pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/8 "2017-12-19T22:33:55Z")

</div>

Okey tomorrow I will tell you if it’s working thanks! (for now I mark you like the correct answer)

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [December 19, 2017, 10:34pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/9 "2017-12-19T22:34:13Z")

</div>

Oh Ok first you need a Character refference. Create a Character Variable in your Widget and expose it on Spawn. [https://i.imgur.com/Imy4vSL.png](https://i.imgur.com/Imy4vSL.png) (Save!)

If you go back to your Character where you create the Widget you will see that new pin. Pass “self” into it like that [https://i.imgur.com/iXuV2mh.png](https://i.imgur.com/iXuV2mh.png)

Back to your Widget in Design view create a Binding. [https://i.imgur.com/u881x3G.png](https://i.imgur.com/u881x3G.png)

And finally do the Calculation: [https://i.imgur.com/PqH24yc.png](https://i.imgur.com/PqH24yc.png)

Thats it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b84f87d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b84f87d1](https://forums.unrealengine.com/u/anonymous_user_3b84f87d1)\
**Post date:** [December 20, 2017, 7:41pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/10 "2017-12-20T19:41:29Z")

</div>

Okey I did it and it still doesn’t work. In my binding, if I set it to float it gives me a error so I set it to boolean but it doesn’t work (but it compails ok) so here you can see in photos:

**Can’t compile with float type:**

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/a/7/1a714fbe4de7791179e142689905465cf01633ef.png)

**Compile but no working boolean type:**

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/0/2c0f8cb75cbbc936955ba9d416f970c2fd83176e.png)

**Reference to player:**

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/9/79982f19ef724569c9aef2489c17de111ecf6809.png)

**Score system Scirpt:**

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/7/477f8500fd644a76b2746aa2a353a3aae040d493.png)

**ProgressBar:**

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/0/6/5064ca111c0444d89fdf9215340eda5925418c08.png)

**In game:**

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/a/eda4a4ec51bd02008ff44bf6c31c1beb4632f26b.jpeg)

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [December 20, 2017, 7:59pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/11 "2017-12-20T19:59:10Z")

</div>

You don’t really need to expose on spawn the Character variable, you can get it on the Event Construct by using Get Owning Player Pawn and then cast it to the type of your character and save it there. Regarding your problems make sure you create a binding from the Percent and not from the isenabled. Usually when you create a new binding he names the function Get ProgressBar\_78 Percent\_0, something like that. Do even need to do any binding to Is Enabled? if you don’t then remove the binding.

---

<div class="post-metadata">

**Author:** ![Nachtmahr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nachtmahr](https://forums.unrealengine.com/u/Nachtmahr)\
**Post date:** [December 20, 2017, 9:35pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/12 "2017-12-20T21:35:26Z")

</div>

Buddy x) [https://i.imgur.com/cUdZwk4.png](https://i.imgur.com/cUdZwk4.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b84f87d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b84f87d1](https://forums.unrealengine.com/u/anonymous_user_3b84f87d1)\
**Post date:** [December 20, 2017, 10:32pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/13 "2017-12-20T22:32:38Z")

</div>

I did stil the same, wat im doing wrong now. Is all the same but now im using the progress binding and still don’t fill up wtf?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b84f87d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b84f87d1](https://forums.unrealengine.com/u/anonymous_user_3b84f87d1)\
**Post date:** [December 20, 2017, 10:40pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/14 "2017-12-20T22:40:46Z")

</div>

I don’t understand (I’m quite new on scripting :P) What are you saying about GetProgressBar\_78? when I create one binding in percent it autoname’s GetPercent0. I did the divide by 100 and still don’t work and I don’t understand the GetOwningPlayerPawn (the cast yes). it still don’t work. :C

Coin script: [https://i.imgur.com/BpXlg0S.png](https://i.imgur.com/BpXlg0S.png)  
Division: [https://i.imgur.com/XjSGz7z.png](https://i.imgur.com/XjSGz7z.png)  
In game: [https://i.imgur.com/QhzSYZV.png](https://i.imgur.com/QhzSYZV.png)

Thanks for ur help dude.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b84f87d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b84f87d1](https://forums.unrealengine.com/u/anonymous_user_3b84f87d1)\
**Post date:** [December 20, 2017, 10:41pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/15 "2017-12-20T22:41:27Z")

</div>

Also thaks you x)

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [December 20, 2017, 10:49pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/16 "2017-12-20T22:49:14Z")

</div>

This is what i mean with owning player pawn:

 ![224587-owning.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/d/f/adffd02c893a5ddb6fa2e91407e6241aebc0aa03.png)

When you bind the percent it should be something like:

 ![224588-coins.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/c/7fcf6944112e8ea7bab7aef755a1492d88141e48.png)

Pay attention to the cast i do to the coins, if you divide coins / 100 you’ll get and integer value and that’s no good, you need to cast the coins first to float and only then do the division. Make sure to remove the binding with Is Enabled like this:

 ![224589-binding.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/0/f/50f10d71d47116c90c9f9d6ed4514bf0eb4c26ae.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b84f87d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b84f87d1](https://forums.unrealengine.com/u/anonymous_user_3b84f87d1)\
**Post date:** [December 20, 2017, 11:06pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/17 "2017-12-20T23:06:34Z")

</div>

Only 1 more question why it doesn’t let me get my coin variable look:

Get coin? (I think now the operation is fixed :D)

 ![224578-getcoin.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/b/d4bb10b2021642feeda24227763c46a226ac9ff4.png)

Here is the coin variable (I’m on my character bp):

 ![224579-coinvariable.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/e/7/8e760e62fb418c317188645d38ef377fa62d0eb3.png)

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [December 20, 2017, 11:08pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/18 "2017-12-20T23:08:22Z")

</div>

That coin was just a local variable i created to exemplify, you want to use the Character reference and get the coins from there, like you where doing, then from the coins you do “To float” to cast it, then it’s the same as my example.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b84f87d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b84f87d1](https://forums.unrealengine.com/u/anonymous_user_3b84f87d1)\
**Post date:** [December 20, 2017, 11:33pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/19 "2017-12-20T23:33:40Z")

</div>

Thank you so much! 😃 it’s working now. 😃

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [December 20, 2017, 11:34pm UTC](https://forums.unrealengine.com/t/printstring-to-progressbar/412690/20 "2017-12-20T23:34:38Z")

</div>

Good to know 🙂
