How to call method and return its value with UnityPlayer.UnitySendMessage
How can I call this C# method from Java then return the string value? public string getTest () { return "test"; } This is what I've tried: String str = UnityPlayer.UnitySendMessage("ProfileSave", "getTest",""); I am getting the below error String str=UnityPlayer.UnitySendMessage("ProfileSave", "getTest",""); ^ required: String found: void Programmer UnityPlayer.UnitySendMessage is a void function and does not return a value. Take a look at the UnitySendMessageExtension function implementation below. It is similar to turnipinindia's answer but it returns a value. It only returns a string so you