# UMG - spawning button at random coordinates

**URL:** <https://forums.unrealengine.com/t/umg-spawning-button-at-random-coordinates/490025>\
**Category:** UI\
**Tags:** button, spawn, random, unreal-engine, Widget, question, UMG\
**Created:** [October 19, 2021, 8:27pm UTC](https://forums.unrealengine.com/t/umg-spawning-button-at-random-coordinates/490025 "2021-10-19T20:27:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gewgreger](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gewgreger](https://forums.unrealengine.com/u/gewgreger)\
**Post date:** [October 19, 2021, 8:27pm UTC](https://forums.unrealengine.com/t/umg-spawning-button-at-random-coordinates/490025/1 "2021-10-19T20:27:40Z")

</div>

Hi there,

I’ve only been working with the Unreal Engine for two weeks now and have decided to prototype a clicker game. A lot of things already work via blueprint. Now, however, I have come across a problem.

* * *

**I want to spawn a button with random coordinates in my Main Widget. For this I only want to use blueprints. The “Bonus” button should be randomly spawned (similar to golden cookies in cookie clicker).**

 ![350628-bonusbutton.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/b/0/4b0e4222b15542c2ac654d38ee6f6026ccb10db8.png)

* * *

I searched a lot and couldn’t find a tutorial on how to do it. I can’t use “Targets” or “Get All Actors of Class” because my entire game is based on widgets.

Is such a thing possible?

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 20, 2021, 7:34am UTC](https://forums.unrealengine.com/t/umg-spawning-button-at-random-coordinates/490025/2 "2021-10-20T07:34:04Z")

</div>

Why spawn the button, when you can just toggle visibility?

 ![350647-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/e/3dedbd55a160018a10c18340e3e8e692a5f00e37.jpeg)
