How to make sprites swap on undock?

I want a maze path to appear when I undock the crank, but they don't seem to appear when it happens.. help?

Edit: For reference, I have a sprite called mazepath with this script:

on undock
swap white
end

might be too simple..

Hi,

Functions like dock and undock can only be called on the player's script

on undock do
 tell x,y to // replace x y to mazepath location
  swap "white"
 end
end
1 Like

ohhh thanks!! That's a big help :playdate_heart:

Edit: is there a way to make multiple tiles swap at one? Sorry for the extra question :sweat_smile:

There is

Just change this from the player's script

on undock do
tell "mazepath" to
 call "SwapToWhite" // you can rename this to anything
end

And add this to the tile's script

on SwapToWhite do
 swap "white"
end

Thanks! That actually solved multiple problems at once for me :playdate_heart: