Skip to content

Connecting a stack to a edge triggered hat behaves differently in 2.0 and 3.0 #2080

Open
@BryceLTaylor

Description

@BryceLTaylor

Behavior

In 2.0, if there is no code attached to an edge triggered hat, when you then attach code to it while the condition is true, it runs the code, even if it was not previously false. In 3.0, the condition must have been previously false on an edge triggered hat in order for it to run.

It looks like 2.0 considers the hat to have been false before attaching any blocks. It has to be the addition of a block to a hat block without any other blocks under it to see this behavior.

Steps to Reproduce

In Scratch 2.0:
Add a when timer > 0 hat block
Drag out a play sound meow block and attach it to the hat
Note: the cat meows even though the timer was already greater than 0

In Scratch 3.0
Follow the same steps as above
Note: the cat does not meow

Operating System and Browser

Mac Chrome

CC @kchadha

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions