Thanks but now I have another problem.
Instantiate(templates.closedRoom, transform.position, Quaternion.identity);
in this line I’m spawning closedRoom but can I change it’s x and y position in the same line? I just need it to be like 2 points higher.
Thank you so much, I’m pretty new to C# and unity may I ask you how long did it take you to understand the code, becouse now I’m just watching those videos and copying code. Could you also give me tips for learning faster?
Personally, I studied Computer Science at a university for 4 years and learned about Unity in my free time for about 3 of those years. I then worked with Unity professionally for about 7 years to date. That’s a long time, but don’t let that discourage you. The hardest part is the beginning, trying to learn all of the concepts you need for the project you’re working on. No one stops learning either; yesterday I learned that I had been doing something the hard way for years that C# has a built-in way of handling. To learn faster, I recommend that you take some free courses on general programming in C#. If you can remember what it was like when you were first learning to read and write, learning programming is something like that. It takes practice. Try not to copy code from other people; it’s tempting, but you’ll hurt your own knowledge doing that. Once you understand what their code is doing and precisely how it works, then you can start copying, but for the most part try to train yourself to do things yourself.
Some of the free web resources I recommend are:
MIT Open Courseware: Structure and Interpretation of Computer Programs | Electrical Engineering and Computer Science | MIT OpenCourseWare
Quill18’s C# series: youtube.com/watch?v=eycAAKpoJxA&list=PLbghT7MmckI7JAftgv0CUdU4RLNivG6wY
(His stuff is usually quite good, IMHO)
Hackerrank problems: https://www.hackerrank.com/
I have no affiliation with any of these things, I just personally like them.
Try following that from beginning to end. By the end you should understand enough to start learning things on your own instead of copying code and not really getting any better.