- Home /
Web Player SendMessage Array Parameters
I'm using the SendMessage function in my html page to send arrays to the unity web player. No matter how I initialize and use the array it always comes through as a length 1024 array in the player, whether I pass in one shorter or longer. Is this a bug? And if not how do I fix this issue?
function SendObjectListToUnity()
{
//var objects=new Array();
//var objects=new Array(3);
var objects =[];
/*objects[0]="object1";
objects[1]="object2";
objects[2]="object3";*/
for (var i=0;i<1100;i++)
objects[i]=i;
u.getUnity().SendMessage("Global Scripts", "SetObjectList", objects);
}
public void SetObjectList(object[] objects)
{
Log(objects.Length);
}
Answer by Graham-Dunnett · Mar 19, 2014 at 03:12 AM
Docs say:
A single string, integer or float argument must be passed when using SendMessage().
Thanks, read that doc about 10 times and totally missed it.
Your answer
Follow this Question
Related Questions
Parse Array data to generate html 0 Answers
Problem with UnityObject2.SendMessage | communicating with the web player 0 Answers
How much data can I send from the browser through unityObject.SendMessage()? 1 Answer
Resize webplayer upon window resize 0 Answers
How to detect when user clicks to install the webplayer? 0 Answers