Skip to content

Local variables are shared between sprites #2429

@apple502j

Description

@apple502j

Expected Behavior

Local variables should not be shared between sprites

Actual Behavior

https://scratch.mit.edu/projects/398917160/ has a local variable ~LOCAL_A that is shared between sprite A and B. The creator didn't say they uploaded the sprite or used backpack, so not #1766 or #1375

WARNING: THE PROJECT LAGS, SEE BELOW FOR WHY

You can see that it's the same sprite because it has the same variable ID:
image

I've run vm.setVariableValue(vm.runtime.targets[2].id, ")|vidmn.3H1=f_,R7RF_", 1) to see how things will be and the result is:

image

I ran refreshWorkspace just to see what happens, and it had no effect. Then I tried switching between sprites and the value still didn't update.

Steps to Reproduce

ggenije said lagging the editor while switching the sprites have something to do with this.

Operating System and Browser

My browser / operating system: Windows NT 10.0, Chrome 81.0.4044.138, No Flash version detected

Thanks ggenije for reporting this bug!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions