Problems with UnityWebPlayer ActiveX

I’m happy that I got the UnityWebPlayer ActiveX work in WinForm but I still have few problems.

  1. You must set “src” property in “Property Editor” within Visual Studio. Setting .src property programmatically won’t work. I wasted a couple of days to find this out. This means that you must load the same static file and load different level within Unity once again.

  2. To set “src” property, you must provide full path. Anything other than fullpath, such as, “level.unity3d” , “./level.unity3d” , “%UnityDir%/level.unity3d” , “$(UnityDir)/level.unity3d”. None of the above works no matter how I try but only the fullpath. It can be problematic when I’m distributing my app. I need relative path to work.

  3. It causes an error in Windows 7. I installed the player correctly (tested using generated .html) but the same project when debugged, says something like “The componenent is not registered”

ps. Two way communication works just fine for those who are interested. I use SendMessage, ExternalCall to communicate between Unity ActiveX and Winform.

Thanks.

Hey Chris. I started looking at setting the src property through code last night. The src does get set to the path, but I believe by the time it is set it is too late. Thinking that something has to tell the control to load the file after the src is set. I’ll look at it some more tonight. Wonder what the ocxState is all about.

Just thought of an idea you might try until I get back. Have the code create a New() instance of the control with the src set to your desired path. Maybe that’s the direction we need to go.

Can anyone help with ocx documentation a Unity? Please.

Programmatically setting src property can be worked around by loading different level in Unity script, thus, I didn’t bother trying to find a fix since I waisted few days on it already.

The bigger problem is that src property works only with “absolute path”. Anything other than that won’t work.

So are you thinking this will be a problem when someone installs the application? You can control that during publishing, except maybe if the application is installed on a different drive letter? Seems as though nobody wants to give any additional info on the component yet. Huh?

That’s correct. User should be able to install the app anywhere they want but the unity file has to be in the fixed location.

Also, I was thinking about upgrading my system to Windows 7 but I can’t because of the bug above.

You are actually using the IE webplayer in your app so if you work with it with that in mind instead of missinterpreting as a “freely usable” ocx component, you will likely be able to solve this problem.

There is no Unity ocx as usage as a form, thats just a sideeffect of IEs flawed plugin support technology. Thats why it didn’t work with 2.5 at all as it was nothing that is beeing tested as it is no supported usage (thus no bug, as a bug is a functionality that works differently than intend / advertised).
You might be able to get around the issues by feeding the data differently than you would for regular ocx or by dynamically pulling it in instead of having it hard wired …
there are surely ways to handle it.

As I understand it, the src was able to be set from within winform in version 1.6. So does this fall back into a bug report issue???

Yes I think so :cry:

Really sorry for resurrecting this very old topic from the death but could someone please give me an example of how to use the SendMessage/ ExternalCall to communicate between Unity ActiveX and Winform? I’d really appreciate :slight_smile:

Thanks