# Adjust spawn on x or y

**URL:** <https://forums.unrealengine.com/t/adjust-spawn-on-x-or-y/416608>\
**Category:** World Creation\
**Tags:** target-point, unreal-engine, Collision, spawning-actors, question, Blueprint, box-overlap\
**Created:** [February 6, 2018, 9:10pm UTC](https://forums.unrealengine.com/t/adjust-spawn-on-x-or-y/416608 "2018-02-06T21:10:14Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![SoulRunner](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SoulRunner](https://forums.unrealengine.com/u/SoulRunner)\
**Post date:** [February 8, 2018, 1:35pm UTC](https://forums.unrealengine.com/t/adjust-spawn-on-x-or-y/416608/5 "2018-02-08T13:35:50Z")

</div>

I figured it out. It may be a variation of what you said. I haven’t given the game a direct spawn after the first but i have taken the spawn from the first and added random floats to give a random location based around the spawn point i wanted. This seems to be working exactly as i wanted. Using event tick during testing to always spawn actors i have made a few functions to keep the spawning running smoothly.

RandSpawn Function: Takes a spawn point (Hardcoded here) and randomises based off that.

 ![229961-054444c86f7e4e6eed68c2bc8c357866.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/1/d51581b0b769b3306cd0aaca522c723cbf6aad7b.png)

SpawnActorFunction: Checks for collisions and either spawns or randomises, then spawns based on collision check

 ![229962-4fe0039e872424045ca5840a9a158e34.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/6/db6cf5ef4e2827e96a6c186f5225b37f921a88d9.png)

 ![229963-1375f207d4bf4fa57c87dd49e36a5ffa.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/0/9/60971b86714b8280cd8ddd1831263ae8262dd12c.png)

I have also set a 2 second timer using CanSpawn to slow down spawn rate.

End Result: (Random spawn on x and y axis)

![229964-b6b067590cd0d10eb8fc5657412149ca.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/3/1232bc3198d9602261ab23a0f6c7305cf02979f5.png)

---

_[View the full topic](https://forums.unrealengine.com/t/adjust-spawn-on-x-or-y/416608)._
