Not able to send message from java to Unity using UnityPlayer.UnitySendMessage

android, c#, plugins, unity-game-engine

Solution

The name of the GameObject must be "testObject" Check if is true: http://docs.unity3d.com/Documentation/ScriptReference/Object-name.html

You need to describe better. Can be a lot of things

Problem

I am trying to create an android plugin in Java. When I am trying to return some message back to Unity using ``` UnityPlayer.UnitySendMessage("testObject", "testMethod", "sample message"); ``` When running the code from unity, I get following exception ``` SendMessage: Object testObject is not found! ``` I have testObject as game object in my scene. I am able to figure out what is the issue here. One other approach I thought can work is if I can use `GetComponent<>`, but for that I have to pass the gameObject (testObject) to java about which I have no idea. Can anybody help me in this?

Original source