Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Java plugin - how do you send a message from Java to Unity?

Discussion in 'Android' started by ina, Oct 28, 2011.

  1. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,080
    how do you send a message from Java to Unity from an Android Java plugin?
     
  2. Mihai_Pendragon

    Mihai_Pendragon

    Joined:
    Nov 7, 2011
    Posts:
    5
    The Java class com.unity3d.player.UnityPlayer has the static method UnitySendMessage, it takes 3 String parameters :

    Code (csharp):
    1. UnityPlayer.UnitySendMessage("GameObjectName1", "MethodName1", "Message to send");
     
    Jonattan and Salazar like this.