# space between actors

**URL:** <https://forums.unrealengine.com/t/space-between-actors/741966>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** space, unreal-engine, question\
**Created:** [January 4, 2023, 12:22pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966 "2023-01-04T12:22:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![LPkinGEN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LPkinGEN](https://forums.unrealengine.com/u/LPkinGEN)\
**Post date:** [January 4, 2023, 12:22pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/1 "2023-01-04T12:22:37Z")

</div>

I have a problem with actors and the problem is when mine actors spawn. They blend together. I do not find any solution.

The code is

 ![Skärmbild 2023-01-04 131927](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/8/e/68e8b8104a3a5109e63847a2789bedd686643da6.png)

---

<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:** [January 4, 2023, 1:23pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/2 "2023-01-04T13:23:02Z")

</div>

Like I say, you need to keep a record of previous spawn points:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/0/ce0254aff56e3dd55d3581295cb471491cac5010.png)

The function to measure and check points is

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/d/8/fd80bd2f37454357d00f3463018bbdb6d0845e06.png)

![random](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/5/b/e5ba875ac432c00050e87bf81ff84a8782fd63dc.gif)

---

<div class="post-metadata">

**Author:** ![LPkinGEN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LPkinGEN](https://forums.unrealengine.com/u/LPkinGEN)\
**Post date:** [January 4, 2023, 2:09pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/3 "2023-01-04T14:09:30Z")

</div>

i will try it. thank you.  
are both coded in same blueprint? or two seperate.

---

<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:** [January 4, 2023, 2:11pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/4 "2023-01-04T14:11:05Z")

</div>

It’s all in the same BP. The second part is a function

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/7/4/17435c3f51bb293e489614444e20ecfb51af7fee.png)

‘Actor distance’ is the minimum distance between them.

---

<div class="post-metadata">

**Author:** ![LPkinGEN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LPkinGEN](https://forums.unrealengine.com/u/LPkinGEN)\
**Post date:** [January 4, 2023, 2:14pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/5 "2023-01-04T14:14:18Z")

</div>

ok. thank you. i will try coding it tomorrow. If i find problem. i will write do you back. If it fine for you

---

<div class="post-metadata">

**Author:** ![LPkinGEN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LPkinGEN](https://forums.unrealengine.com/u/LPkinGEN)\
**Post date:** [January 5, 2023, 10:53am UTC](https://forums.unrealengine.com/t/space-between-actors/741966/6 "2023-01-05T10:53:28Z")

</div>

what is a used location. Is it a varable?

---

<div class="post-metadata">

**Author:** ![LPkinGEN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LPkinGEN](https://forums.unrealengine.com/u/LPkinGEN)\
**Post date:** [January 5, 2023, 12:10pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/7 "2023-01-05T12:10:21Z")

</div>

you solution do not work fo me. i want objekt that can make a space between actors and i want to tell you i am beignner in unreal. reason is i making a 2d game. A pawn goes right to left. All i need to do is make mine actors not blend to each other. I really no not understand you code.

---

<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:** [January 5, 2023, 1:27pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/8 "2023-01-05T13:27:15Z")

</div>

I see you have the bounding box in a straight line. This code can do that too.

Just change this

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/6/6/c669a9664db0e4bf8b6d97d0940ad10adb8cfd81.png)

to

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/d/4/cd4d37b1663fd3aad9bbe7c4f6d602506d95d5cc.png)

( or whatever size you want it to be )

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/1/1e184a37aecc476de43c05d82f80dec543d479ec.jpeg)

---

<div class="post-metadata">

**Author:** ![LPkinGEN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LPkinGEN](https://forums.unrealengine.com/u/LPkinGEN)\
**Post date:** [January 5, 2023, 2:24pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/9 "2023-01-05T14:24:07Z")

</div>

![Skärmbild 2023-01-05 151836](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/9/a099edc8d958b358c174659db677f1571f5ea71f.png)  
I did it to my code. But the blending between actors. Is still there

But if you speak about your own code. That will be a problem and reason is i do really not understand your code. I tried to code it. But i got a problem for each loop node. The problem is. The node do want connect with used locations vector.

---

<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:** [January 5, 2023, 2:43pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/10 "2023-01-05T14:43:26Z")

</div>

Can you point to the piece of code you can’t make?

---

<div class="post-metadata">

**Author:** ![LPkinGEN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LPkinGEN](https://forums.unrealengine.com/u/LPkinGEN)\
**Post date:** [January 5, 2023, 6:13pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/11 "2023-01-05T18:13:05Z")

</div>

![image (1)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/5/d/35d8b160fb69dd438781efd43cf8f1b494f545e5.png)

---

<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:** [January 5, 2023, 6:21pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/12 "2023-01-05T18:21:08Z")

</div>

The 'used location’s variable is an array of vectors.

Just make a vector variable, and then you can make it an array 🙂

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/b/2/5b28f7339c1b58fc345af11770b0a0f4df73e7f2.png)

---

<div class="post-metadata">

**Author:** ![LPkinGEN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LPkinGEN](https://forums.unrealengine.com/u/LPkinGEN)\
**Post date:** [January 5, 2023, 6:34pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/13 "2023-01-05T18:34:06Z")

</div>

it wont work. get red warning. but it works if i use map and i get find  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/1/d91bf2bd9c9449f66e67042f82d77205f46f84c5.png)

---

<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:** [January 5, 2023, 6:54pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/14 "2023-01-05T18:54:19Z")

</div>

Map is no good. We are going for a range, not a precise point.

Can you show me the error?

---

<div class="post-metadata">

**Author:** ![LPkinGEN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LPkinGEN](https://forums.unrealengine.com/u/LPkinGEN)\
**Post date:** [January 5, 2023, 7:00pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/15 "2023-01-05T19:00:06Z")

</div>

![Skärmbild (13)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/0/260369296d58b8252c5109dc4defc79a1385aeab.png)

---

<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:** [January 5, 2023, 7:40pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/16 "2023-01-05T19:40:41Z")

</div>

Drag from the ‘used locations’ variable, a search box appears, type ‘clear’

You can’t use the clear node from another piece of code.

---

<div class="post-metadata">

**Author:** ![LPkinGEN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LPkinGEN](https://forums.unrealengine.com/u/LPkinGEN)\
**Post date:** [January 5, 2023, 7:45pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/17 "2023-01-05T19:45:18Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/1/d91bf2bd9c9449f66e67042f82d77205f46f84c5.png)  
maybe you miss it. but i can’t find it.

---

<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:** [January 5, 2023, 7:46pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/18 "2023-01-05T19:46:08Z")

</div>

After you have made the function, and compiled, this node will be in the list. It’s a call to the function.

---

<div class="post-metadata">

**Author:** ![LPkinGEN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LPkinGEN](https://forums.unrealengine.com/u/LPkinGEN)\
**Post date:** [January 5, 2023, 7:47pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/19 "2023-01-05T19:47:37Z")

</div>

ok thanks

---

<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:** [January 5, 2023, 7:49pm UTC](https://forums.unrealengine.com/t/space-between-actors/741966/20 "2023-01-05T19:49:28Z")

</div>

We will get there 🙂

[Next page](https://forums.unrealengine.com/t/space-between-actors/741966.md?page=2)
