How do I make enemies ( just dots) to spawn and then move into random direction

So i am making a game, and I don’t know how to make (About 20) dots spawn in random locations on the screen and the move randomly.
Its 2D
I am still a beginner so i dont know much yet.

Thanks for all the help

Hello, the unity api under 2D physics is what you would be after, I haven’t done much 2D before but that will point in the correct direction for making the new dot move.

And for creating it.

Gameobject dot = Instantiate(prefab, AtLocation, Quaternion.identity) as Gameobject;

This is untested but gives a rough idea, you can then call the current spawned dot as its created and mosify its values.

If this is unhelpful let me know and I can go through some tests and respond with a clearer anseer when not on my phone.

Google these 2 things for what your looking for with code examples

Unity api instantiate
Unity api 2D rigidbody. (Or physics I can’t remember off the top of my head which one it is)

If you need further assistance I can also skype and TV.

@aquilinajake

Ok now i need to just figure out for what is thing in the code is and will see :smiley: (Because i know nothing about c#