0

I'm instantiating an UI dynamically under $ui. The issue is that chat_button is rendered over $ui, even though the layers are set to be 1 ($hud) and 10 ($ui) respectively. Since chat_button itself is not focusable when I open my chat, which makes sense, it doesn't make sense for $hud to be rendered over $ui.

func _update_opened(layer: Variant):
    self._opened = layer
    layer.on_close.connect(func():
        self.remove_child(self._opened)
        self._opened = null)
    self.add_child(layer)

func open_chat():
    if self.is_closed:
        var chat = preload("res://src/chat/chat.tscn").instantiate()
        chat.on_close_by_send.connect(func():
            self.on_chat_close_by_send.emit())
        self._update_opened(chat)

Scene

Hydroper
  • 344
  • 2
  • 9
  • 1
    I am unable to reproduce this. Will you add to your post a [MRE](https://stackoverflow.com/help/minimal-reproducible-example)? – hola Sep 02 '23 at 04:35

0 Answers0