How to Spawn actor in random Y location

I am trying to spawn an actor from a BP in a random point along the Y axis. Currently trying to get it to spawn in a box I made, but when I try and spawn it the current way, it just spawns in the middle of the box every time.

(BTW the delay node was just to start spawning 4 seconds into the game but it is irrelevant in this post)

Hey SuperSalyanBro9,

I just gave this a try and it works for me. Also your Min and Max values are the same, which will cause the actor to always spawn in the same place.

Let me know if that helps.

Cheers,

TJ

I think you should change the value of seed that is used for Rand().
Plz check the website
Hope it will be helpful.

You have some things to change there:

  1. Random float in range, from and to are the same, so it will be always 5.

  2. 5 is actually a very small value for a location (it is almost 5 cms I think), try to spawn your actor in editor, then move it +5 in any axis, you probably will note no difference at all. try something bigger, like -500 to 500.

  3. Collision handling override, be sure is set to “Always spawn, ignore collision”

  4. TransformLocation method I think is used to change from local space to world space, use “PLUS” instead, otherwise will spawn in 0-0-0 of the map.