0

Is it possible to control the camera in a Unity3D project being played on the Web player?

I want to control the walk through of existing models using JavaScript in the web player.

I see they have API functions for calling internal functions defined within the script, but don't see any way to gain access to the camera.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
Bill
  • 305
  • 6
  • 25

1 Answers1

1

By API, I assume you mean the SendMessage approach outlined in the documentation. That is indeed the best way to approach this. Write a script which controls your camera, expose functions you can call, and call those using the

function ControlCamera()
{
    u.getUnity().SendMessage("MyCamera", "Control", "");
}

approach.

Other than that, to the best of my knowledge, there is no real exposure of a full API that lets you control GameObjects or components attached to them from JavaScript in the manner you seem to be requesting.

Bart
  • 19,692
  • 7
  • 68
  • 77
  • I thought of that approach, but it requires adding a function to that project. I want to be able to control ANY project, whether I have access to edit it or not. Sounds like its not possible? – Bill Aug 12 '14 at 18:29
  • I don't know of a way @Bill and to the best of my knowledge it does not exist. – Bart Aug 12 '14 at 21:46