Using Unity in Storyline 360

Jun 18, 2023

Hey guys,

 

I'm working on a project which requires to use Unity game in the storyline 360 file. I have added the Unity file as webGL component. In the review link and in the SCORM version, on clicking the Unity component, it opens in a new tab. Is there any possibility for us to view the Unity file in the same file? And also on clicking a button at the end of the Unity game, the module must move forward. Is there any possibility for that as well? 

 

Right now, I am able to make the webobject to be displayed in the slide itself, but still on clicking the button, it doesn't move to the next slide. Kindly help me with this.

 

Thank you for your time and support!

7 Replies
Tomas Blazauskas

It is possible.

1. Of course - you need to export the Unity project for Web and place it in the same server where will be published your Storyline project.

2. You need to add Unity project to Storyline as a Web Object.

3. In order to interact, you can set Storyline variables from Unity (just keep in mind that the Web Object uses iframe, so to get Storyline player reference (on Unity side), you need to use parent.GetPlayer(). On the Storyline you can use "when variable changes" trigger to react to the changes made on the Unity side (for example - to move forward after one finishes the Unity side).

Jay Cooper

Tomas,

Is there a way to do this without having to place the Unity project as a separate file on a server? 

It's been a while, but as I recall I was able to publish the Unity file and place it inside my Captivate file, then publish the Captivate file and it ran on my LMS and the Unity portion worked just fine. The Unity portion couldn't talk to the Captivate file, but I didn't get that far.  I did assume, as you indicate, that some JS would have done the trick.

Thank you very much.  I appreciate the response!

v/r

Jay

Tomas Blazauskas

I'm not really sure about the integration of Unity inside the Storyline project. Maybe you can add Unity files as the Storyline resources (I didn't try that).

I don't fully understand yet, why you don't want to put the published Unity project separately. You could even upload Unity files in the Storyline's published folder so they are in the same place.

And... how do you use the published Storyline project in your LMS? Upload SCORM package?

 

Jay Cooper

Tomas,

Yes, our Storyline projects are published as an uploaded SCORM package to the LMS.  

As I recall (again, been a while) I created a web object/iframe in my Captivate file and then link it to my published(?) Unity project.  Then when the Captivate file was published it pulled the Unity file in.  

My organization was hot on using Unity for about a year, then the fire died (mgm't lost interest).  I've changed jobs, so I'm just thinking about possibilities.

Thanks much Tomas.

Tomas Blazauskas

Sorry for the delay.

So, this is how you should do it:

1. Insert web object (Unity folder)

2. When Unity finishes what it is supposed to do, you need to execute such javascript code (you'll find in internet how to do it):

player = parent.GetPlayer();
player.SetVar("unity_finished", true);

3. In the storyline, when the timeline of the first slide starts, you need to set a boolean (True/False) variable called unity_finished to false.

4. In the storyline on the Unity (web object) slide, you need to add a trigger on variable change, with the variable being unity_finished.  Optionally within the trigger, you may check if the value is true.

That's it.