space between actors

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

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

The function to measure and check points is

random

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

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

‘Actor distance’ is the minimum distance between them.

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

1 Like

what is a used location. Is it a varable?

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.

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

Just change this

image

to

image

( or whatever size you want it to be )

Skärmbild 2023-01-05 151836
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.

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

image (1)

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

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

image

it wont work. get red warning. but it works if i use map and i get find
image

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

Can you show me the error?

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

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

image
maybe you miss it. but i can’t find it.

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

ok thanks

1 Like

We will get there :slight_smile: