Godot Version
4.2.1
Question
Trying to setup a button so that it is hidden at first, shows up when the mouse hovers over it, then disappears again when the mouse moves away. Here’s my code:
‘’’
using Godot;
using System;
public partial class draw : Button
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
Visible = false;
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
private void OnMouseEntered()
{
Visible = true;
}
private void OnMouseExited()
{
Visible = false;
}
}
‘’’
I’ve been able to confirm that the signals are connected because if I make the button visible to start with I can make it disappear through setting that value in either signal method, but I can’t make it visible again. Do these functions just not work on a hidden object? If so, is there a setting to make it so they do?