I am trying to spawn coins in a straight line.
This is what I have tried so far - http://prntscr.com/bf9su4 and this is what it looks like - http://prntscr.com/bf9t9n
I want the coins to spawn in a straight line in the collision box.
Can someone pleas help me.
Thanks in advance
Here’s one way to approach it:
Basically at each loop…
- Taking the Index and multiplying it by an increment in distance between each coin (10 units in my case)
- Setting that result as the X relative location
- Created a Lane Enumeration (Left, Middle, Right) and set it as an editable variable so it’s unique per tile
- Check the Lane enum variable and through a Selector node based off the Lane Enumeration we made
- Setting that result as the Y relative location
That worked brilliantly but for some reason when i set the enum to the distance between my lanes, the coins only spawn in the left hand lane. Is there any way to change this without having 3 separate spawn instances
Are you setting the lane per instance of the Actor in your map?
You could also do the same by instead of using an enum, a float variable so you can set the Y relative location amount of units per instanced Actor.
Tried using an array but it isn’t very consistent - http://prntscr.com/bfex87
The script - http://prntscr.com/bfexu9
You’re choosing a random lane every loop, so it isn’t going to be a straight line as the coins will be scattered.
If you want it to choose a random lane and spawn all the coins in that single lane, you should do it before the for loop and store the value into a variable to be used as the Y value.