You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No two distinct variables in a given project should have the same ID.
Actual Behavior
Two different local variables in different sprites can share a single ID. This interferes with monitors. Although each sprite can independently access and modify their own copy of the variable (changing the variable in one sprite doesn't change it in the other sprite), the user will only be able to show one of the two variable monitors.
Steps to Reproduce
Create a new project
Create a variable "for this sprite only"
Drag a block which uses your new variable (e.g. set foo to 0) onto the workspace.
Add a second sprite.
Select your first sprite. Click the block you added to the workspace in step 3, and copy it to your clipboard with ⌘C. (Presumably this would be ctrl+C on Windows/Linux?)
Select your second sprite. Paste the block you copied with ⌘V (or ctrl+V, etc).
Operating System and Browser
Mac OS X, Chromium 111.
This may be a duplicate of #2429, but that issue seems to be caused by some sort of race condition in very large projects . By contrast, the problem described above can be easily replicated in projects of any size, and I've had it come up frequently while teaching students in schools.
Notably, if you drag your block between sprites (share the love) instead of using ⌘C and ⌘V, the new local variable will be created properly. It's merely copying and pasting that causes problems.
Where is the code responsible for fixing variables that are dragged between sprites, and could that same code be applied to pasting?
The text was updated successfully, but these errors were encountered:
Wowfunhappy
changed the title
Copying and pasting (⌘C / ⌘V) blocks between sprites can cause local variables to share the same ID
Copying and pasting (⌘C / ⌘V) blocks between sprites can cause local variables to share the same ID.
Apr 2, 2023
Expected Behavior
No two distinct variables in a given project should have the same ID.
Actual Behavior
Two different local variables in different sprites can share a single ID. This interferes with monitors. Although each sprite can independently access and modify their own copy of the variable (changing the variable in one sprite doesn't change it in the other sprite), the user will only be able to show one of the two variable monitors.
Steps to Reproduce
set foo to 0
) onto the workspace.Operating System and Browser
Mac OS X, Chromium 111.
This may be a duplicate of #2429, but that issue seems to be caused by some sort of race condition in very large projects . By contrast, the problem described above can be easily replicated in projects of any size, and I've had it come up frequently while teaching students in schools.
Notably, if you drag your block between sprites (share the love) instead of using ⌘C and ⌘V, the new local variable will be created properly. It's merely copying and pasting that causes problems.
Where is the code responsible for fixing variables that are dragged between sprites, and could that same code be applied to pasting?
P.S. See also: #1766, #1375
The text was updated successfully, but these errors were encountered: