A little help for someone new?

I really dislike asking for help but sometimes it’s just needed.

I’ve been working with Game Maker for a very long time and am proud to say that I’m very good at it but as of late the restrictions that it has with speed has me a little upset. I started using unity a when it first became free but never really dove into it but I would like to change that. Now as for my project, I’m trying to make a grid that will form land masses in which it will create pre made models into the world. Simple? Well I made a 2d version of what I’m trying to accomplish in Game Maker but I am unable to fully convert the GML to JavaScript.

My first problem is the grid. In game maker I used the ds_grid functions but all I’m able to find in unity are arrays. I can make it with arrays in game maker but in unity I’m complete baffled by how the arrays work.

My next problem is creating the objects in the game view. Once I figure out how to make the grid I can find where the tile objects go but how to I put a prefab object in the world at that point?

I’m sure there will be more questions once you guys begin answering my inquiries.

Thanks for the time and any help that you can give me will be most appreciated.

You should look up for javascript basics tutorial about arrays
Think of them as memory blocks in your RAM. That means one variable can have multiple values by assigning an array to it.
like: myArray[ ] can be anything from -infinity to +infinity, whatever you specify. That means you can have for example 4 values under 1 name: ie. myArray[0], myArray[1], myArray[2], myArray[3],
this can be used to numerate stuff like IDs of objects. Throw in “for” loop and you can manipulate your arrays on the go. Really thats as brief as i can explain, sorry.

There are 2 ways of placing prefabs in the scene: 1) by draggin in with mouse and setting it’s Transforms accordingly either by mouse or keyboard … and 2) by instantiating trough code (look at script reference “Instantiate”) where you can adjust Vector3 position trough variables or integers/floats.

What did i miss?

Thank you so much for your reply.

If I understand what your saying about arrays I can do something like “var myArray[0,0] = 0”? Will the 2D array work?
Do you have any preference of basics tutorial about arrays?

By “Instantiate” do you mean “Instantiate (original : Object, position : Vector3, rotation : Quaternion) : Object”
If I’m right this clones the prefab and places it in the game window? If so thank you.

nope it won’t work. Arrays are single values - integers or floats. You can however calculate square magnitude (.sqrMagnitude) of both axes to get a float number out of your Vector2.

Yes by instantiate i meant this
All it does is clones current prefab (prefabs consists of Mesh, coliders, particles, lights, textures, billboards, whatever you want) in one. So if you were to create 2D tiled game, all you need is simple math to instantiate your tiles automaticly and make 3D space look-alike 2D game. Check out this example, it’s awesome resource

For reference just hit F1 in your UniScite and it will come up with offline script reference with lots of code examples, it’s really powerfull resource.
For basics on how arrays works you can find any tutorials on almost any C++ alike (including C++) language. They all works the same.
Lookie at this youtube video simple and useful. It’s however C++ example, but idea is the same