2

I have four identical scratch sprites, but only one of them do what I expect and I need to know why so I can continue with my project

I have tried reloading the page multiple times but it still won't work

When (Green Flag) clicked forever: if touching mouse-pointer? then: set (Enclosure Hover) to 1 else: set (Enclosure hover) to 0

I expect this to change Enclosure Hover to 1 when the mouse is touching it but it doesn't change it at all.

Lordimass
  • 97
  • 2
  • 6
  • Do you have any scripts that are using one of those sprites in another sprite? Can you share the project and link to it here? – Mithical Mar 31 '19 at 07:06

4 Answers4

2

If the variable is global, all sprites will compete to change it. Hope that helps!

0

You have to add the code to all the sprites that you want. Duplicating a sprite, then adding code to one of the sprites does not add the code to every sprite.

VFDan
  • 831
  • 10
  • 26
0

One way is to add code to one sprite, then duplicate the sprite with the code in it. The code will be duplicated along with the new sprite.

WarpPrime
  • 215
  • 5
  • 20
  • Funnily enough, you described exactly what I did! I have come up with an alternative to this problem, thanks anyway. – Lordimass Apr 19 '19 at 16:03
0

You will need to duplicate the sprite only after the sprite has the code in it so that the 4 sprites do the same thing. I guess what you have been doing is to duplicate the sprites then adding the script into only one of them.

Account_2
  • 53
  • 6