# Generate random stats to weapons

**URL:** <https://forums.unrealengine.com/t/generate-random-stats-to-weapons/1316712>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint\
**Created:** [September 29, 2023, 4:05pm UTC](https://forums.unrealengine.com/t/generate-random-stats-to-weapons/1316712 "2023-09-29T16:05:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pocquer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pocquer](https://forums.unrealengine.com/u/Pocquer)\
**Post date:** [September 29, 2023, 4:05pm UTC](https://forums.unrealengine.com/t/generate-random-stats-to-weapons/1316712/1 "2023-09-29T16:05:46Z")

</div>

How can I make weapons generate random stats? The system I created only saves the information in the Actor itself, I can’t transfer the weapon’s stats to the widget, they are always blank. Could anyone help? giving me a tip or even explaining how I can make this work.

---

<div class="post-metadata">

**Author:** ![ImAGoodSpoon1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/imagoodspoon1/32/757809_2.png) [@ImAGoodSpoon1](https://forums.unrealengine.com/u/ImAGoodSpoon1)\
**Post date:** [September 30, 2023, 8:27am UTC](https://forums.unrealengine.com/t/generate-random-stats-to-weapons/1316712/2 "2023-09-30T08:27:34Z")

</div>

Hey @Pocquer ,

Generating random stats on weapon is just as simple as randomized the stat. Maybe for example take on weapon damage, maybe you want to cap the minimal and maximal damage. Then, just do a random between the MinDamage to MaxDamage, and just set that new randomized stat to the weapon.

About the weapon stat that not shown in the widget, that probably because of false binding or something. I can’t know about that since you don’t show the code. Can you show the code to make us understand about your problem better?

Edit:  
Also IF you want to generate more random complex stat for the weapon, just give me the example of what you want first then I will reply based on what you want

---

<div class="post-metadata">

**Author:** ![Pocquer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pocquer](https://forums.unrealengine.com/u/Pocquer)\
**Post date:** [September 30, 2023, 11:46pm UTC](https://forums.unrealengine.com/t/generate-random-stats-to-weapons/1316712/3 "2023-09-30T23:46:48Z")

</div>

Thank you very much for responding, so here’s what it would be like

I am using a data table to organize all items

(BP of the component that randomly generates the stats)

 ![A](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/8/b/e8bbcdb3779621d8e24a472633b80f26dfcdcc72.png)

(BP from the same component telling you what to do with the generated stats)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/f/a7f81a2f6d24560a72720e8aad3ff0b931476ca6.png)

(BP where the item ID is located)

 ![C](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/a/30a23e5f27848f346d1c8d37f5f7f7ae85c69e6b.png)

(Item base Beginplay)

 ![D](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/a/4/0a4783fdae23706b1205b02dffad142373a1e3fa.png)

(Items tooltip)

 ![E](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/f/6effb39a92b535883bca54aaf9eae14f7d6a6801.png)  
 ![F](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/6/c/f6c1b76e5f81b140266bbffd43ce638c4846e3af.jpeg)

---

<div class="post-metadata">

**Author:** ![ImAGoodSpoon1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/imagoodspoon1/32/757809_2.png) [@ImAGoodSpoon1](https://forums.unrealengine.com/u/ImAGoodSpoon1)\
**Post date:** [October 1, 2023, 1:07am UTC](https://forums.unrealengine.com/t/generate-random-stats-to-weapons/1316712/4 "2023-10-01T01:07:41Z")

</div>

Hello,

You said that the randomized stat already randomized in the actor itself so let just fix the widget binding first. Have you already bind the SwordName / the rarity in the widget blueprint? please show it if you have

---

<div class="post-metadata">

**Author:** ![Pocquer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pocquer](https://forums.unrealengine.com/u/Pocquer)\
**Post date:** [October 1, 2023, 6:34pm UTC](https://forums.unrealengine.com/t/generate-random-stats-to-weapons/1316712/5 "2023-10-01T18:34:23Z")

</div>

The widget is just that

 ![Captura de tela 2023-10-01 153148](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/9/0/4904b111d5bd606be27099a234c7d87bf263c0d6.png)  
(This create widget has nothing important)

---

<div class="post-metadata">

**Author:** ![ImAGoodSpoon1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/imagoodspoon1/32/757809_2.png) [@ImAGoodSpoon1](https://forums.unrealengine.com/u/ImAGoodSpoon1)\
**Post date:** [October 2, 2023, 12:50am UTC](https://forums.unrealengine.com/t/generate-random-stats-to-weapons/1316712/6 "2023-10-02T00:50:32Z")

</div>

The widget creation seems fine, about the variable binding to the widget do you already check that there is no problem with that? are those data sent correctly?

---

<div class="post-metadata">

**Author:** ![Pocquer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pocquer](https://forums.unrealengine.com/u/Pocquer)\
**Post date:** [October 3, 2023, 12:00pm UTC](https://forums.unrealengine.com/t/generate-random-stats-to-weapons/1316712/7 "2023-10-03T12:00:24Z")

</div>

Yes they are, but they don’t reach the widget

---

<div class="post-metadata">

**Author:** ![ImAGoodSpoon1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/imagoodspoon1/32/757809_2.png) [@ImAGoodSpoon1](https://forums.unrealengine.com/u/ImAGoodSpoon1)\
**Post date:** [October 3, 2023, 1:55pm UTC](https://forums.unrealengine.com/t/generate-random-stats-to-weapons/1316712/8 "2023-10-03T13:55:31Z")

</div>

can you show the Widget Blueprint where you bind it?
