- Home /
Is it possible to create a hole for a door in a wall-like cube?
I am doing a project for school and I am a total beginner with Unity and C#, so I may not know a lot of terms that people may share. My problem is that I need doors in my game and a LOT of doors at that. I want to make a hole for the doors so when they are opened (I still don't know how to open them but that is for a different question) a character can walk through the hole in the wall that is for the door. But, I do not have any idea of how to do this because, as I said, I am a total beginner with Unity and C#.
I hope I explained that alright, let me know if you have any questions about what I am doing, and I will be happy to answer them.
How are you creating your walls? In unity? $$anonymous$$aybe you are using cubes to make the walls for example and scaling them to size, well, you need to have three cubes to represent the wall, one for on top of the door and one for each side of the door. This is just an example and it is better practice and more optimized to have a seamless mesh. I would recommend doing some blender tutorials to learn to create custom 3D objects which will be ready to be imported into unity
Answer by sandro_lord · Apr 04, 2019 at 08:25 AM
you should model the wall so it has a hole in it in the first place. you can use programs like blender to do it or make 3 cubes, 2 walls one top.
Answer by Kermadec · Apr 04, 2019 at 11:47 AM
If you know how to use modelling tools like Blender, I'd recommend you make a wall with space for a door and export that, it wouldn't be all that hard to do, even with the most basic of knowledge of the program.
But, if you want to another (but kinda hackjob) method is to make the shape you need using three cubes shaped as you need them, then either make them children of an empty gameobject or make two of them children of the other. That will do the trick but beware if you're using physics.
Hope this helps, feel free to ask if you need any other help with this ^^
Just to add on the hackjob method, once you have the shape you need and that all set up, I'd recommend making it a prefab so you don't have to keep doing it.
Your answer
Follow this Question
Related Questions
Reduce APK file Size with Vuforia 0 Answers
unity showing download file delay 0 Answers
Private and public variables 2 Answers
Unity LoadAssetBundles changes Material into Pink ? (URP) 0 Answers