Copy link to clipboard
Copied
Does anyone know if there is a way to have a running unity build working in captivate. Basically we want to have it when someone goes to its slide, the game is already running in the slide. I know I can export unity to an webgl and have captivate open a webpage with unity running but we are wanting it to run in captivate itself. Any ideas or help would be greatly appreciated.
So, Captivate has the ability to embed an IFRAME into the middle of a page - it is really simple. There is a Icon called "Object" on the toolbar, with the last element being "Web"
You have the choice of pulling up a web page by the URL or you can specify all the iframe parameters by using the "embed code" option. The Embed code option is pretty interesting - you can put any HTML code you want in there..
a typical HTML iframe spec looks like: <iframe width="854" height="800" src="//www.yo
...Copy link to clipboard
Copied
You should try to reach out to EJ Leblanc (https://twitter.com/ejleblanc). My guess is that if there is one person who can address your question, it would be EJ.
Copy link to clipboard
Copied
Thank you, I think I will reach out to him.
Copy link to clipboard
Copied
So, Captivate has the ability to embed an IFRAME into the middle of a page - it is really simple. There is a Icon called "Object" on the toolbar, with the last element being "Web"
You have the choice of pulling up a web page by the URL or you can specify all the iframe parameters by using the "embed code" option. The Embed code option is pretty interesting - you can put any HTML code you want in there..
a typical HTML iframe spec looks like: <iframe width="854" height="800" src="//www.youtube.com/embed/o_znYZ7Ry-0" frameborder="0" allowfullscreen></iframe>
Copy link to clipboard
Copied
That may be an option and is definitely one worth exploring especially if it opens it within the captivate slide itself. Thank you for the information. I am going to give it a go and let you know how it goes.
Copy link to clipboard
Copied
I am also interested in this, did you get it to work?
Copy link to clipboard
Copied
Hi All!
I got it to work and it works like a charm when you embed a link in captivate, however I would like to natively integrate the html files in captivate instead of providing a url link on the web object, can we embed the files in captivate. the motto is that there is no dependency on the internet connection. Rest all is working fine.
Copy link to clipboard
Copied
Yes, there are a few different ways to do embedding, however I think there may be a distinction between what you are talking about with respect to "no dependency on an Internet connection"
If the unity files are placed in a directory below the course index file, you can use relative url address information to access it even if it is embedded as an iframe. This approach does not require a webserver. The downside is that you need to push the unity files back into the module every time you update the module.
A relative url simply uses directory/filenames rather than http://
I typically set up a monitor routine that watches for when the captivate module has been updated, then I post process to add in extra files and directories as needed.
Copy link to clipboard
Copied
Hello,
I would like to continue with exploring possibilities to use the unity games as learning objects.
My question is:
After we embed the unity game inside captivate, is there any possibility to combine the game score with the SCORM output data? Other words, can Captivate use the output data from the unity game to set the user status of the entire SCORM object?
Thanks.
Copy link to clipboard
Copied
assuming that the embedded unity game is being served by the same web server so that the iframe meets the security requirements, it is possible to pass javascript variables up from the iframe to the parent frame. if you have the ability to create custom javascript from within the unity game frame, you can simply set a result variable in the parent iframe. captivate can read this variable and use it. pushing it into a "total" score that is reported through SCORM through captivate can be done either by creating a invisible quiz object that you set the value of and then activate, or report directly in SCORM. I've done the former, I've seen posts on the latter.
Copy link to clipboard
Copied
Thanks for a quick answer and very useful answer.
I will continue with analyzing the possibility to export appropriate javascript data from the unity game to the parent frame. After that, I will come back with new possible questions.
Thanks again.
Copy link to clipboard
Copied
Steve:
Hi. I'm coming into this thread 6 months on, but very much interested in the same problem of Captivate/Unity integration. So is EJ, with whom I've been in contact, but he seems to be somewhat skeptical about your IFrame/javascript solution, maybe just because of limitations that you're well aware of. Indeed right now he's asking me to help him explore xAPI as a possible mediation route. Have you looked into this at all? From what I can tell, Unity can certainly both read from and write to an xAPI source like an LRS, and obviously Captivate can publish results TO an LRS; but can a running Captivate session read from an xAPI source? I'm far more familiar with the Unity than the Captivate side myself, so I'm just casting about for answers. Meanwhile, I would love it if you could see your way clear to sharing an example project of the kind you discuss here--I mean Unity and Cp project code, not just the output result. I believe you that it works, at least under controlled circumstances, I'd just love to see the details.
Matt
Copy link to clipboard
Copied
regrets for not seeing this question until now.
Having done a complete system implementation of an xapi installation, I cannot see how xAPI helps you in this case. In fact, I believe it will seriously distract you.
as these kinds of configurations are pretty specific to the application need, I'd have to look at the exact problem to provide potential options.
Copy link to clipboard
Copied
Sir...can you tell me how you made this work? I'm trying to do the same thing (gov't employee, no competition with you) and would appreciate some specifics on how you made this work.
Jay
Copy link to clipboard
Copied
I was very excited to find this discussion string this morning as I'm trying to do this exact same thing...put a Unity game inside a Captivate course. I'm very new to writing code, so I'd very much appreciate it if someone could give me some more detail as to how you made this happen (e.g. how you output the Unity project, exactly where within the Captivate files do the Unity files need to go, what do you enter into the "embed code" in the web object, etc.). Â
As always, I appreciate the help.
Jay
Copy link to clipboard
Copied
the specific solution is a function of the environment you are running in. in some cases, people have separate servers for the unity games. in others, they want the game to be "part" of the course files themselves. this impacts how the URL is encoded and the level of interaction between the unity course and the captivate module. at a minimum, if the course is being served as http://domain/module and the unity course is at http://another_domain/unity.html then you just use " http://another_domain/unity.html " as the URL in the web object.
regards
Steven Warwick
Copy link to clipboard
Copied
Steve,
I need the game to be "part" of the course files...we need server space for stuff like this, but we aren't there yet.
As I understand it, I'd need to run the game through a Captivate WebObject (i.e. an iFrame), but I don't know where to point it or where to put the files needed to run the game.
Jay
Copy link to clipboard
Copied
ok, so the way you do this is to:
1) "publish" the captivate module but NOT as a zip file.
2) go to the directory where the published course is. ( there will be an index.html file there and a bunch of other directories. )
3) create a new directory ("unity" ) at that location. drop your unity files into that directory
4) your web object html link will look something like "./unity/index.html" or whatever file unity starts out with. note the dot slash at the beginning. you shouldn't need to specify the IFRAME, just this as a "relative" URL the HTTP:// should not be needed.
the course can now can be zipped and shipped as a single unit.
the REAL PROBLEM with this approach is that anytime you re-publish the course, the unity files will be deleted. As a developer, I typically set up a "watch" system that notices when the module has been republished and backfills all of the stuff that got erased. this is a very fragile approach since any new developer working with the course will not know this and will likely forget to backfill the needed files.
Frankly, One of my pet peeves with captivate is the lack of an ability for me to specify such module-related files or directories and include them automatically upon publish.
Copy link to clipboard
Copied
Steve...I can't thank you enough for the help. I'm going to give this a try and see what happens.
I can see your concern about needing to backfill. Our office is small enough at the moment that this shouldn't be a problem (anything I build I eventually end up updating as well), but I will keep it in mind for when we eventually grow.
Thanks again...I appreciate the help.
Jay
Copy link to clipboard
Copied
Hey Steve...I'm coming back to the well for some more information if you don't mind.
Have you had an issue with any specific browser when running an embedded course? I'm stuck for the moment with delivering the course over IE 11 (Fed gov't; don't ask). It looks like my Unity file tried to run, but I received an error message from within the course saying: Please note that your browser is not currently supported for this Unity WebGL content. I selected the "OK" option, and then got another error message from webpage: An error occurred running the Unity content on this page. See your browser JavaScript console for more Info. The error was Object doesn't support property or method "log?" The relative portion of the console log (I think) is below.
Any help you, or anyone else, can give would be greatly appreciated.
Jay
Copy link to clipboard
Copied
this is not about captivate, it is about Unity. it's just not compatible with IE11:
https://docs.unity3d.com/Manual/webgl-browsercompatibility.html
Copy link to clipboard
Copied
Thanks Steve...this is what I was afraid of. Time to go to the IT folks and tell them to catch up with the times!
Jay