- Home /
invisible walls
how can i make invisible walls so i dont have to put a huge rock face to keep the player out of the end of the map
Answer by networkZombie · Mar 15, 2011 at 12:40 AM
make wall shaped cubes and in the inspector uncheck mesh renderer
make sure they all have colliders. don't check "trigger" either.
also, planes don't always work as well as cubes for collisions at high speed. to be safe, use cubes always.
$$anonymous$$
i have a day night cycle. i did the wall shaped cubes and it worked out perfectly, but its in the way of the sun. any suggestions?
perhaps you can put the wall shaped cubes in a special layer that the sun can ignore?
Answer by ash_richie · Mar 16, 2016 at 03:05 PM
Use a cube as your wall
and in the inspector UNCHECK the MESH RENDER
AND ALSO IN LAYER CHOOSE TransparentFX
m.png (10.0 kB)
l.png (10.7 kB)
Answer by Jaakk0S · Jan 16, 2021 at 04:13 AM
I found that using a single cube works not, cos the BoxCollider fills and collides with everything inside it.
Make a prefab with 4 cubes under an empty gameobject. Remove the cubes' Mesh Filter and Mesh Renderer. Leave the BoxColliders. Mould the cubes into flat "fences". Give them coordinates to match the grid. I used a length of 50 each, rotated 2 of them 90 degrees, place them at 25 and -25... you get the picture... until they form a rectangular closed fence.
You can reuse the prefab and scale it to desired dimensions.
Your answer
Follow this Question
Related Questions
Model shows in "Game" preview, but not in actual game 2 Answers
I can only view my objects in 2d mode??? 0 Answers
Character turns invisable on build 0 Answers
Instantiated object is not visible in game 2 Answers
nothing is visible in scene view 3 Answers