Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Open World Inaccessible Areas, Best Approach?

Discussion in 'World Building' started by The_Nerd_Sherpa, Jan 4, 2019.

  1. The_Nerd_Sherpa

    The_Nerd_Sherpa

    Joined:
    Dec 11, 2018
    Posts:
    57
    I'm creating an open world, but there are areas that I don't want the player to go. What is the most optimal way to block them?
    Use a series of planes and disable the mesh rendering?
    Use a series of cubes with box colliders and disable the mesh rendering?
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    You don't need to disable renderers; if you want an invisible wall, just make an empty GameObject and add a BoxCollider to it.

    (But of course invisible walls are lousy game design... please try to use these only as a last resort.)
     
  3. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,995
    Well the most "optimal" way would be to design the enviornmnt so they cannot get there, and not make it feel like they can. Skyrim is a good (mostly, early before later patches you could still get over the mountains sometimes) example as it surrounds the map with organic mountain flow that ensure players dont feel they are getting stiffed out of seeing part of the map.

    The easiest way would be an invisible wall, but as pointed out that is really a terrible game design mechanic that shouldnt really be used
     
  4. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    965
    I think Borderlands had turrets that blasted you to bits if you exited the allowed zone? :)
     
    TylerCode_ and Kurt-Dekker like this.
  5. The_Nerd_Sherpa

    The_Nerd_Sherpa

    Joined:
    Dec 11, 2018
    Posts:
    57
    Wouldn't that mean a bunch of cliffs and boulders etc. with mesh or box colliders? If so, that doesn't seem as optimal, each one would have to be rendered individually, as apposed to using a single collider around them.....

    I probably didn't ask the question correctly... I'm going to have terrain features that will visually look like a barrier, but I dont want to have a seperate collider for each of them..... just one collider. I've only been at this for a few months and I'm trying to avoid common mistakes.
     
  6. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    965
    Oh. That's easy. Install ProBuilder and build collision chunks around your visual meshes, in whatever shape you need. Because it's PB, you can tweak/edit in Unity if you change the visual mesh position/size/etc :)

     
    JoeStrout and Lurking-Ninja like this.
  7. The_Nerd_Sherpa

    The_Nerd_Sherpa

    Joined:
    Dec 11, 2018
    Posts:
    57
    Haha, thats Great, thanks! Exactly what I was looking for. I have been using ProBuilder but I haven't discovered the "collision chunks" yet. I'll check it out.
     
  8. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    We used the BF approuch for our game, if you leave the battlezone you have 10 seconds to go back
     
  9. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    965
    Nothing too special with the "collision chunks" :) we just provide a shortcut that applies the"see through green grid" material, and disable the visual mesh at runtime. Let me know if you have any troubles!
     
    biogicfps and TylerCode_ like this.