Sending messages not working

  • Hi,

    I have setup a project where if I click a sprite, it will send a network message to "others in the room". And upon receiving this message the sprite should say hi. So to test, I created a new role and invited a user (second account). However when I click on the sprite, the other user does not have their sprite say hi on their screen.

    Am I misunderstanding something about how messages work? How would I fix this problem?

    Thanks for reading!

  • administrators

    Hello diamondblock123456,

    Can you double-check that the second role has code to have the sprite say hi when it receives a message? I suspect the issue is that roles do not share code, sprites, costumes, etc. If you are familiar with Snap! and/or Scratch, a role is like an independent project in either of those languages.

    In other words, it sounds like the first role contains all the code but the second role is an empty project (so the sprite won't say hi when it receives a message).

    The easiest way to fix this problem would be to add a message handler in the second role which has the sprite say hi upon receiving the message. (You could also use the "Duplicate" option from the room tab when creating the role which will create the role from a copy of the first role.)

    Hopefully this helps!