# How do you send more than one data in Shared AR?

**URL:** https://community.nianticspatial.com/t/how-do-you-send-more-than-one-data-in-shared-ar/3548
**Category:** I'm Stuck
**Created:** [May 18, 2023, 9:11am UTC](https://community.nianticspatial.com/t/how-do-you-send-more-than-one-data-in-shared-ar/3548 "2023-05-18T09:11:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Peng\_Han\_Kum](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@Peng\_Han\_Kum](https://community.nianticspatial.com/u/Peng_Han_Kum)
#### Post date: [May 18, 2023, 9:11am UTC](https://community.nianticspatial.com/t/how-do-you-send-more-than-one-data-in-shared-ar/3548/1 "2023-05-18T09:11:49Z")

</div>

_Include the following details (edit as applicable):_

- **Issue category** : Multiplayer
- **Device type & OS version** : Android
- **Host machine & OS version** : Windows
- **Issue Environment** :
- **Xcode version** :
- **ARDK version** : 2.5.1
- **Unity version** : 2021.3

Description of the issue:  
private void OnDidReceiveDataFromPeer(PeerDataReceivedArgs args)  
{  
var data = args.CopyData();  
switch ((\_MessageType)args.Tag)  
{

```
    case _MessageType.BallPositionMessage:
      _controller.SetBallSpeed(DeserializeFloat(data));
      break;

    default:
      throw new ArgumentException("Received unknown tag from message");
  }
}

```

In the code snippet above, I need to pass 2 data inside “\_controller.SetBallSpeed(DeserializeFloat(data));”

meaning, the code should look something like  
“\_controller.SetBallSpeed(DeserializeFloat(data1),DeserializeFloat(data2));”

I am aware you need to create a new “DeserializeFloat”

private float DeserializeFloat(byte launchSpeed)  
{  
using (var readingStream = new MemoryStream(launchSpeed))  
using (var binaryDeserializer = new BinaryDeserializer(readingStream))  
return FloatSerializer.Instance.Deserialize(binaryDeserializer);  
}

How can I do this in the OnDidReceiveDataFromPeer()?

Pardon me for the long code snippet.

---

<div class="post-metadata">

### Author: ![Jesus\_Niantic](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jesus\_Niantic](https://community.nianticspatial.com/u/Jesus_Niantic)
#### Post date: [May 19, 2023, 8:33pm UTC](https://community.nianticspatial.com/t/how-do-you-send-more-than-one-data-in-shared-ar/3548/2 "2023-05-19T20:33:53Z")

</div>

Hello Peng,

Thanks for your patience. Also a quick note that I saw your questions on Discord as well and the Bot has since been fixed. If you prefer Discord you’re able to use it again.

As for your question. So unfortunately we don’t have a Float Array Deserializer but I can think of two different ways you can approach this. [Here is a link](https://lightship.dev/docs/ardk/api-documentation/namespace_Niantic_ARDK_Utilities_BinarySerialization_ItemSerializers.html) to the Deserializers we have.

The simplest approach is probably to use our Vector2 serializer so you can put in your two float values in a Vector2 and then after getting deserialized just pull them out into individual float values.

This one is a bit more complicated but you can treat both your values as just a byte array which would mean converting them into an array of bytes. Since Floats are 32 bits, you’ll have a byte array of 8 bytes, the first four are the first number and the last four are the second number but you would need to create the bit manipulation that would fill the array and split the values back out as two floats.

---

<div class="post-metadata">

### Author: ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)
#### Post date: [March 5, 2026, 11:44pm UTC](https://community.nianticspatial.com/t/how-do-you-send-more-than-one-data-in-shared-ar/3548/3 "2026-03-05T23:44:48Z")

</div>

Age
