Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to add audio or image into scene from client side code

Discussion in 'Scripting' started by Vidhyut, Apr 8, 2014.

  1. Vidhyut

    Vidhyut

    Joined:
    Oct 29, 2013
    Posts:
    10
    Hi,

    To access function from client side we use
    u.getUnity().SendMessage("object","method","parameter").
    Same way how can I add audio or image into scene or on some object with this client side code?

    Thanks,
    Vidhyut
     
  2. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    Client side code will not work in Unity. However, if you do a search in google for LUA and Unity. You will find a LUA parser which will let you work with client side code.
     
  3. Vidhyut

    Vidhyut

    Joined:
    Oct 29, 2013
    Posts:
    10
    can't this u.getUnity() object help to access gameObject?
     
  4. shaderop

    shaderop

    Joined:
    Nov 24, 2010
    Posts:
    942
    I believe the OP was referring to communicating with Unity web player from the browser.

    OP: Best bet is to pass the URL to the image or audio file and handle loading them from inside the Unity web player.
     
  5. Vidhyut

    Vidhyut

    Joined:
    Oct 29, 2013
    Posts:
    10
    But how to do that on client side? I can do the required stuff easily when am coding in mono developer ide of unity, there I can use gameobject easily.
    what I want to do is all using "u" object, all from client side.