Use multipeer patches to build effects that can be applied to a group on a video call.
For example, you could create an effect where one participant tapping the screen triggers something else to happen in other instances of the effect, like changing the other participants’ background. This type of effect is called a group effect in Meta Spark Studio.
Group effects:
If you're familiar with scripting, you can also use the MultipeerModule API to build group effects.
There are 2 multipeer patches and they're available in the Multipeer section of the Patch Menu. You can use these patches to make group effects, alongside 3 Utility patches: Pulse Pack, Pulse Unpack and Throttle.
Multipeer patches
Name | Description |
---|---|
Multipeer Send | This patch works with the Multipeer Receive patch to send information between instances of an effect used by different video call participants. To send multiple pieces of information as a message, use the Pulse Pack patch to pack and input information into this patch. |
Multipeer Receive | This patch works with the Multipeer Send patch to send information between instances of an effect used by different video call participants. Messages can only be sent between peers — you can’t send a message to yourself. |
Utility patches
Name | Description |
---|---|
Pulse Pack | Pack and send information using a pulse signal. Must be connected to a Pulse patch. |
Pulse Unpack | Unpack information from a packed pulse signal. Use this patch with the Pulse Pack patch. |
Throttle | Throttle a given event to a specified duration. |
These patches let you package numerical, boolean, text or Vector2, 3, 4 data from one instance of an effect into a message to send to another instance.
The message is sent on a specified channel. You can have multiple message channels within the same effect.
Each message is made up of the data to input plus a key, which is a textual representation of the data being sent.
In the graph below, when the screen is tapped, the Pulse Pack patch packs information and sends it to the Multipeer Send patch.
In this instance the information is someone’s name represented by the FirstName key. GameTopic is specified in the Multipeer Send patch. This is the channel the message will be sent on.
For each additional piece of information you want to package into the message, connect a separate Pulse Pack.
In the example graph below, we added two Pulse Pack patches because we want to send FirstName data and Position data on the mouth.
Once the message is sent, it’s received by another instance of the effect via the Multipeer Receive patch. The Multipeer Send and Mutipeer Receive patches transmit data without a connecting cable, as long as the same Topic is specified.
Keep in mind that you can’t send a message to yourself. You need to have both Meta Spark Player and Meta Spark Desktop player open when building your effect, in order to test how different instances of your effect communicate.
When the message is received you can unpack it with a Pulse Unpack patch and connect to further logic to trigger something in your effect. In the image below, the Pulse Unpack patch unpacks the message containing someone's name (Lucy) and sends this information to a Value patch.
When you’re building your group effect, you can try the effect on more participants in Meta Spark Player for Desktop.
In the example below, we’re previewing a group effect in Meta Spark Desktop player, to test how it would appear on a video call with 3 participants. 1 of the participants is represented by the Simulator in Meta Spark Studio. This participant is labeled User. When the User or another participant blows a kiss, we see a heart appear on the device screen of Participant 1 and Participant 2, and disappear again after 2 seconds.
We created this logic with the patch graphs below:
Sending the message
The top patch graph in the Kiss Event and Send Message box counts how many kisses are detected and sends this message on the SendHeartTopic channel.
We did this by connecting:
Finally we entered:
Receiving the message and making the heart visible
The patch graph in the Message Received and Heart Visible box makes a heart appear each time this message is received. And then disappear again after 2 seconds.
We did this by connecting the Multipeer Receive patch to:
We then entered:
Finally, we connected:
The Pulse Unpack patch is not triggering anything to happen in the effect, it’s simply unpacking the message to retrieve a number for the last kiss count.
You could connect this patch to other patches to make something else happen based on the number of kisses detected, adding more complexity to this effect.
To help you get started using patches to build a group effect, we've provided the Send to a Group template in the Meta Spark Studio Welcome Screen.
We walk you through the template in this article.
In these 2 group effect workshops, expert creators demonstrate how to use Multipeer patches and the Multipeer API to exchange data in a group effect.Rewatch the sessions to learn how to: