Skip to content

Resolve Global/Local Variable Conflicts from Importing 2.0 Projects #1379

Open
@kchadha

Description

@kchadha

In Scratch 2.0, projects can sometimes have a global and local variable have the same name and type. This breaks monitors and and variable behavior in 3.0.

Resolve these conflicts when importing 2.0 projects:

Solution:

  • If the stage and a sprite have a variable of the same name and type, rename the sprite variables to avoid conflicts with the stage variable. This maintains 2.0 behavior where the sprites that had the conflict could only access their local variable anyways. Only sprites without a name conflict could access the global variable.

Repro

  1. Create a local variable in scratch 2 sprite
  2. Share that reporter to the stage by dragging
  3. Click on that variable block in the stage
  4. Open that project in 3.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions