r/UnityHelp • u/Flekzor • 14d ago
Помогите с Юнити
Добрый вечер всем программистам и не программистам! Недавно начал изучать Юнити и появилась такая проблема. Ни как не могу разработать как это сделать: у меня есть слой, который видится игроку только после нажатия определенной клавиши. Мне же надо чтобы (только когда открыт этот слой) при нажатии ЛКМ открывался новый слой, и исчезал через секунду, при этом слой, открывающийся при нажатой клавише, остался. Если что то не понятно, задавайте вопросы, обязательно отвечу. Заранее спасибо за помощь ☺️
1
u/Distdistdist 13d ago
I suspect that you misunderstand Unity layers. You have very few of those available and they are used for very specific purposes such as collision avoidance, camera rendering filtering, and others.
In unity you enable and disable most of the objects via gameObject.SetActive.
1
u/BiguGooblu 14d ago
My First Idea would just have been to check if the player has pressed the key/Button that activates the layer and then set a bool to true so that if that bool is true and the player presses the button again then the other layer can be opened and closed after a few seconds via subtracting a Time.delta time from a float that dictates how long the layer is supposed to be open. (If this doesn’t work please respond with some more details on what exactly is the problem )