- Home /
Add borders to landscape
I'm currently developing a script to automatically instantiate a number of meshes in a scene that create a landscape when correctly positioned together. I've completed the first part of the script that instantiates each mesh, creating the landscape, but I'd also like to add invisible border at the edge of the landscape to prevent the player from falling of the landscape. Normally this would be easy to accomplish, simply by creating a cube object and manually moving it to the correct position along the edge of the landscape. However, I'd like to automate this process such that the borders on each of the four sides of the landscape are instantiated at the same time as the rest of the landscape. Is there any possible method of finding the coordinates of each landscape edge via script so that I can accomplish this? More specifically, I'd like to develop a method of finding the coordinates, in world space, of where the landscape ends and empty space begins.
Your answer
![](https://koobas.hobune.stream/wayback/20220612202943im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Lost in translation... and by that I mean coordinate systems 1 Answer
Is there any way to set a Gameobject's transform matrix to be the World Space? 0 Answers
How to successfully transform local mesh vertex coordinates into world coordinates? 1 Answer
Why do you need to invert the X value during mesh export? 1 Answer
How to obtain the world space coordinates for each individual vertex on a Mesh? 1 Answer