I am trying to use visual scripting to make a 2D GameObject invisible in the beginning, and by left-clicking it becomes visible. I got something like below but the GameObject maintains invisible after starting to run. When left-clicking, sometimes the object appears for like a frame and then goes off, and most of the time it just stays invisible. Could someone help me understand why and how to correct? Thanks in advance.
Set enabled boolean
for no.
For yesss
If pressed and is enabled, sets to disabled. If pressed and is disabled sets to enabled
You mean on the 2nd Set Enabled node? I think what I did here is just that, by connecting output of GetMouseButtonDown to the boolean input of Set Enabled, so when clicking it is 1, when no clicking it is 0, isn’t it?
1 Like
Problem solved. Remove On Update event trigger and Get Mounse Button Down. Replace them with On Mouse Input event trigger, and it works as expected. ChatGPT helped.
1 Like
