Forum Discussion
WilB00X
4 years agoHonored Guest
Unity spatial anchor query error
I'm trying to query the spatial anchor in this way:
OVRPlugin.SpatialEntityUuid[] uuidArr = new OVRPlugin.SpatialEntityUuid[numeroAncoreTovate];
for (int i = 0; i < numeroAncoreTovate; i++)
{
byte[] byteArray = AnchorHelpers.StringToUuid(ancoreSalvateStanza.anchorData[i].spaceUuid);
uuidArr[i] = new OVRPlugin.SpatialEntityUuid
{
Value_0 = BitConverter.ToUInt64(byteArray, 0),
Value_1 = BitConverter.ToUInt64(byteArray, 8)
};
}
var uuidInfo = new OVRPlugin.SpatialEntityFilterInfoIds
{
NumIds = numeroAncoreTovate,
Ids = uuidArr
};
var queryInfo = new OVRPlugin.SpatialEntityQueryInfo()
{
QueryType = OVRPlugin.SpatialEntityQueryType.Action,
MaxQuerySpaces = 50,
Timeout = 0,
Location = OVRPlugin.SpatialEntityStorageLocation.Local,
ActionType = OVRPlugin.SpatialEntityQueryActionType.Load,
FilterType = OVRPlugin.SpatialEntityQueryFilterType.Ids,
IdInfo = uuidInfo
};
ulong requestId = 73;
if (!OVRPlugin.SpatialEntityQuerySpatialEntity(queryInfo, ref requestId))
{
Debug.LogError("Unable to retrieve the spatial anchors saved on the device");
}
but I get this error:
ArgumentException: Type could not be marshaled because the length of an embedded array instance does not match the declared length in the layout.
What can it be? I'm sure that array uuidArr is fully populated...
Replies have been turned off for this discussion
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 2 years ago
- 4 years ago