Easier way to manipulate objects?

I’m trying to make an enemy manipulate a spike object in different ways.
Every way I’ve done it is either super messy and doesn’t work or just super messy which messes up my work flow. How do I make objects appear consecutively in a row on the ground like this?

Spikes

Or randomly like this…

Spikes_Random

Hey!

While I’m not so certain about creating them randomly (as you’ve shown), I may be able to offer some help for consecutive creation.

In terms of creating them consecutively, you could use a timer (preferably an object timer for the specific enemy) to create them repeatedly until a maximum is reached. Something like this:

Just make sure to disable the timer or have extra conditions in your spawn event, otherwise you could create infinite objects! Please lemme know if the example needs explaining at all.

I do have a suggestion that may work for both, but it is not as nice/clean as individual spike creation. You could have a “Spikes” object that has all the spikes and is animated to create them consecutively/randomly. Basically creating an object with the animations like you’ve provided.

If you want them to be random, you could have 5 different animations with unique spike formations, and use the Change the animation (by number) action and set it equal to Random(the number of animations here).

Again, please let me know if that needs better explaining!

OB

It worked PERFECTY but are there any other variable names besides Pos to know about?

Well it all depends on your specific situation. From what you’ve mentioned, they don’t seem necessary. Maybe you want a PosY variable for Y positions, or an Is_Attacking variable for your enemy (boolean), etc. Basically, the more control you want over certain aspects the more variables you should/could have.