How can I make a grid based building system like in the game "My Prison"?

  1. What do you want to achieve? Keep it simple and clear!

    I want to create a grid based placement system similar to the one used in My Prison. I would like to learn how to make it from scratch so that I can use it in my games.

  2. What is the issue? Include screenshots / videos if possible!

    I don’t really know where to start, I’m not very familiar with placement systems and so I would appreciate any help I could get.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

    I’ve tried using open source placement systems to see how they work but I don’t understand like any of it. Most of the math is really complicated and it’s all just a huge mess for me. I’ve also looked at a few YouTube tutorials but most haven’t been to any help.

Thanks in advance!

Well, I build similar system like in theme park tycoon 2 but it’s grid system. Just use raycast loop( model preview ) and create raycast too when you click (Model placement), and pivot your model when you click but you have to roundify your x and z value for getting the column and row like this:

local gridsize = 9

local function gridsignal(Hit)
 Local row = math.floor(Hit.X/gridsize)
 Local column = math.floor(Hit.Z/gridsize)

 Model:pivotto(Row*gridsize, 0, column*gridsize)
end

Ofcourse it’s not full script but it’s main logic. if you have more question you can as, it to me but you can check this document: