UE to LA - trigger video from start

Hello,

Is there a way to play a video from the start with LA when an event in realtime occurs in UE, at any time in the timeline ? (And playing the video only if a specified event occurs, not all the time in background would be even better, performance wise.)

What I would like to do is to start a video from the beginning when the player go inside a trigger box in UE.

At my current state, I am able to make the video appear in LA when I go inside a trigger box in UE thanks to your online tutorial where you blend textures depending on a float variable. But I am unable to make it start from the beginning :
I used the Video Reader box and I tried to connect the Start at node to my float reader box, connected itself to the shared memory listener, I thought that it would make the video start at 1s each time I go inside the trigger box in UE (the value of the float is 1 when the player is inside the trigger box), but nothing happen, the video continue to play normally (it’s already playing by itslef in background).

I tried different things, but I am unable to make it work… is there a way to do this ?

Here is what I made, (it’s a 2D scene, it is then related to another layer)

Thank you,

Liam

Hello Liam,

Thanks for your question. Interesting approach you took there!

Please see below a layout I created just now which forces a reload of the video and when that happens it starts to play from the beginning.

I created a boolean variable called forceReload. Normally it is set to false so the video plays. When I press ‘k’ key on my keyboard (that’s done with the Key Press node on the bottom right), this variable is set to true. This causes the Video Reader node to become inactive for one frame. In that frame (that’s what the If and Bool Setter nodes are doing) the forceReload variable becomes false again. When that happens, Video Reader node becomes active again and the video is reloaded and starts to play from Start At position.

I hope this makes it clearer. I guess that in your case, you should set forceReload to true based on the data coming from UE4.

Some additional notes: 2D Scenes were primarily designed for real time 2D texture generation. In your case, where it seems you just want to save the video texture into a texture variable, you can use regular layers like shown above.

Let me know how it goes,
Mitja

Hello Mitja,

First thanks a lot for your quick answer, that already helps me !

But I also already tried to use a boolean before, and the thing is I didn’t find any solution to connect it with my shared memory listener from UE. That’s why I tried to use a float
Basically, here is what I have when I set a bool in UE :

BoolSharedMemory
I can read the datas but not transform them, there is no string to bool box available after that

I also tried to use the success bool node in the shared listener from unreal (that’s why I used the bool reader on the picture above), but without results (I suppose that’s logical somehow)

Is there any other way to get the bool properties form UE?

Thanks for your advices for the 2D scenes, I will keep that in mind ! It was just for me to make it clearer on the main layer, does it take more performances ?

Thank you for your time,

Liam

Hello Liam,

Could you keep your float variable from UE like you have now and based on it set a boolean variable in Lightact as shown below?

As far as I understand you receive float data from UE4 which tells you whether the player stepped into a trigger area, right? So the idea explained above should set a boolean to true if that float is larger than some value and to false if it is smaller or equal.

Would that work?

Hello Mitja,

Yes, basically what I am trying to do here is to do a projection video mapping on an object that will change depending on where the player is located in UE. First, There will be a first video playing in loop on the object that is gonna be the standard texture. And when the player go inside the trigger box in UE, the new video blend with the standard one and starts (Where it has to start from the beginning, because basically it is related to the first one).

So I reproduced what you did, and it sets up the bollean when the float is higher than a number : this part seems to work
But then I tried to combine all the events (with a sequence box), and the boolean just stays to true state all the time. Despite the fact that the float still changes to 0 when I go out of the box.

So here Is what I did :

I have to stay I am a little bit lost, it is possible that I did something wrong, or dumb. And you probably noticed i am not a programmer, I am just a pationate digital artist/ designer that is doing its best to learn as much as he can and try to push his boundaries.

Thank you for your help,

Liam

Hello Liam,

I’m afraid I can’t reproduce your issue on my end. Please see the video below showing how it should work:

You can see that forceReload boolean variable switches to True when float is above 0.5 and to False when it is below 0.5.

The chain at the bottom also shows the correct boolean value.

I am also attaching the project that I created when making this video.
booleanTests.la (21.2 KB)

If you still experience this problem please send over the project file so I can have a look at it.

Best of luck!
Mitja