[Solved] Layer not hiding/showing correctly

Hello again, I have yet another issue with my game. This time, I am developing an inventory system (ish, I’m not using the dedicated inventory function as it’s too complex) for my visual novel and my Court Record (what my inventory is called) is supposed to hide on beginning the scene (which it does), show when I press C (which it does) and then hide when C is pressed again… which it then doesn’t do. The code below shows what my code for hiding and showing the layer is.

Other things that could be breaking it are as follows:
This code to hide/show certain sprites, dependent on a Yarn Variable

This Yarn node below does also get skipped over, and the variables for the above image are in this scene. Could also be that, but I think the commands are fine.

Can anyone help with this?

Hi, when you use the same key for two different actions you need to track that with a variable:

Additionally, for keypresses and mouse button-presses you should add a “Trigger once while true”-condition, otherwise the keypress is registered and triggered constantly, which may give you unwanted results.

2 Likes

Thank you! This works now :slight_smile: