So, I am not even quite sure of how to inquire about this, however, I have a simple test game built where squares will “swarm” a player object.
My initial thoughts (which I am still using) was to build a prefab with a movement script attached, and then build a spawner object that will spawn the moving prefab clone.
As might be obvious this poses a problem because I can only build a prefab with objects already present within the game, meaning that my prefab is already moving when I start the game.
Obviously this functionality is unwanted. So I have paused to ask how I SHOULD be approaching this situation.
My goal is to spawn squares at a determinable rate and speed. I know I COULD do this in one script, but I was thinking it would have been cleaner and more organized to have the movement and spawning functionality separate from each other.
One solution I was thinking of was to only ‘move’ the prefab IF it is in or out of a certain area – ie, IF prefab is in game area, move as intended, otherwise don’t. This would allow be to set up any number of different styled moving objects.
But again I am unsure of what the right course of action would be. Or, at the very least, the most advisable course.
Thank you sincerely for any help. – also, I apologize if my intentions aren’t very clear, don’t hesitate to ask for clarification!