Download

Set timer by function name trouble when "Time" is too low

Hello everyone,

I have a 2D shoot them up with Z = UP / X = Right & Left / Y = constant value

→ I’ve made a “Spawner BluePrint” in which i have two “Set timer by function name”, with a X Time value
→ This timers spawn simple “Cube BluePrint” i’ve made, with randoms “X axis” clamped at certain value in order to keep a minimum distance between this two “Cube BluePrints”
→ This two “Cube Blueprints” move to a lower Z position in a Y Time value (With move component to assign into the Cube Blueprint when “Begin play” )

The problem is : When **X (“Time” value of the “Set timer by function name”****) **value is too low (for exemple 0.03), the cubes don’t spawn and/or travel true “Z axis” correctly.

For information, Y value is relative to X value (When X is low, i lower Y Time value), in order to make the BluePrint Cube stay near each others. [HR][/HR]
This is what it looks like when X is too low (here 0.03) and **Y **= 1 seconds


[HR][/HR]
This is what it looks like when X is NOT too low (here 0.33) and **Y **= 9 seconds :

My question is :
How can i do in order to make this more precise ?
I can’t figure out how i can fix that :confused: [HR][/HR]
The “Cube blueprint” :


[HR][/HR]
And finaly, the Spawner BluePrint, who spawn the two “Cube Blueprint” :
**FULL SIZE SCREENSHOT HERE **-----> https://forums.unrealengine.com/file…4&d=1602329411

**Thanks a lot **to everyone for help & for your time, please tell me if something is not clear, or if more information is needed.

Hi man, i think is a problem with the timer, the 0,33, i think that will never be perfect , sometime will be 0,335
to fix it i think you can Spawn the next cube based on the location of the previous.

So, every 0,33 or whatever,
Last_cube_A get location , + vector (RandomX,0,Distanceofthecube), Spawn a new cube, save this as Last_Cube_A

This way every cube will be at the same Vertical distance , they may appear 0.1 sec later of sooner , but they will be all perfectly distanced.

@Est_engine thanks a lot you’re genious !
Actually i’m maybe going to change some things so maybe i’m not going to use this anymore (i’m maybe just going to use gravity to make them fall with axis lock).
But i will try and tell you if it’s working better. :slight_smile: