Eng:Hide (block)

The Hide block is a Looks block and a Stack block. If the block's sprite is shown, it will hide the sprite if the sprite is already hidden, nothing happens. This block is one of the simplest and most commonly used Looks blocks.

Example Uses
This block is widely used, mainly in preparing scenes and such for a Scratch project. Some common uses are: when gf clicked hide switch costume to [ghost v] set [ghost v] effect to (100)
 * Preparing a scene

when I receive [haunted v] show repeat (20) change [ghost v] effect by (-5) end when gf clicked go to front hide
 * Hiding a sprite in front of an object to reveal it

when I receive [chest opened v] show say [You found me!] for (2) secs when gf clicked say [You know how to play hide-and-seek, correct?] for (3) secs say [Well you're it! Come and find me!] for (3) secs hide go to x: (200) y: (-120)
 * Simply hiding a sprite (hide and seek, for example)

when this sprite clicked show say [You're really good at this!] for (3) secs when I receive [Shoot! v] show point in direction [mouse pointer v] repeat until (touching [edge v]?) move (8) steps end hide when clicked switch to costume [empty-handed v] say [Hello and welcome to the morning news!] for (3) secs say [Oh wait, I forgot something backstage. I'll be back in a sec!] for (4) secs hide wait (2) secs show switch to costume [coffee v] say [Got my coffee! Now, where were we again?] for (2) secs
 * Hiding a bullet once it hits something
 * Animation scripts

when gf clicked hide
 * The block is also sometimes used simply to hide everything but a menu at the start of a project.

Workaround
This block can be replicated with the following code:

set [ghost v] effect to (100)

However, this does not completely work, as it can still be sensed. Also, it reappears when the project is stopped or restarted. The hide block prevents the When this sprite clicked from activating, but using ghost effects does not.

If the workaround is used, the Show block will not work. The ghost effect must then be set to 0.

Also, sprites cannot evaluate some scripts such as say or ask while in hide mode, however they can using the ghost effect.

Another workaround is switching the costume to a blank one. switch costume to [blank costume v]