Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

How would someone make a Fortnite like Editing system?

Discussion in 'Game Design' started by suIly, May 18, 2022.

  1. suIly

    suIly

    Joined:
    Jun 21, 2017
    Posts:
    17
    I can figure out the building system really easily, i am just wondering how you would be able to add editing structures as in Fortnite, like how it would store or read the patterns and change the builds to suit it.
    Would it be like a crafting system redesigned or...? editing.jpg (image isn't mine)
     
    Last edited: May 18, 2022
  2. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    It is very complex...

    You could make that the walls are made by 9 small squares, and when you are in edit mode you activate/deactivate them.

    The correct way of doing it will be to make a class with a 2d bool array and a model, then you will have a container of all possible combinations, and when editing you will check if the current layout is equal to one in the array of a class in the array of classes
     
    suIly likes this.
  3. suIly

    suIly

    Joined:
    Jun 21, 2017
    Posts:
    17
    Thank you for responding! I am confused as to how to make the combinations recognized. I have an idea of using 0s and 1s for values, 0 if not selected, 1 if selected, but I am looking for a way to string all the values of all the gameobjects together into a string of values to be more easily processed and stored.
    For example, 0, 0, 0, 0, 1, 0, 0, 0, 0, would be an edit window
     
  4. suIly

    suIly

    Joined:
    Jun 21, 2017
    Posts:
    17
    I think I understand a bit, but could you elaborate?

    And also 2d bool arrays? I'll check it out. Thanks r31o!

    (Just searched up 2d bool arrays)! This would help a lot! Thanks! How would I put all the values into it? Make it public and apply gameobjects to the value, right? I'm hoping this would work.
    Thanks again r31o
     
    Last edited: May 23, 2022
  5. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    Its r31o!!!!!!

    Something like that. Each combination will have a corresponding gameObject
     
  6. suIly

    suIly

    Joined:
    Jun 21, 2017
    Posts:
    17
    agh sorry, I was typing in a rush.
    How would I save the combinations to the script?
    (edit) I'll try this first and ask later.

    Thanks for the quick reply
    r31o
     
  7. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    You could use scriptable objects, containing the 2D bool array and the corresponding piece. Note that you cant edit 2D arrays in the inspector (That sucks), so you will have to "hack" them a bit with an array of classes that contains a array of bools (Or use a standard array, like you said
    Use the method you find most intuitive.

    Doesnt matter :p
    In fact, my name is a typing error :rolleyes:
     
  8. suIly

    suIly

    Joined:
    Jun 21, 2017
    Posts:
    17
    Ok! Thanks for the help and such quick replies! Hope I get it to work.