Trigger a video to play through a material? - Even possible?

Options

Hi everyone,

Currently working on a lens and found and followed this video tutorial as a base for one of the effects I was attempting to create: https://www.youtube.com/watch?v=rKAYt8kQiCw

Created this effect: https://gyazo.com/2a4774cf8dde23f3c7d12506452db084

Essentially it is just a transparent texture image, with a scrolling alpha texture revealing the image as it goes.

The problem is that I only want it to play once and stop on the final frame. I have a feeling that this isn't possible at least not currently based on the fact that there is no parameter to refer to in the script for the texture itself, let alone any form of playback controls in the material editor.

Mostly just interested to see if anyone has messed with materials enough to have found a way, but won't be surprised if it isn't do-able and needs to be handled a different way. Was just trying to prevent the need for numerous animated textures down the line.

Tagged:

Best Answer

  • Tariq B
    Tariq B Posts: 96 🔥🔥
    #2 Answer ✓
    Options

    Hello there!

    If I understood you right, I would suggest you use just a simple use of Behavior Script

    Let's say when the user tap on screen it goes from frame 0-100 and it takes for example 4 seconds.

    Then Simple, you can go to Behavior Script to do the following:

    1. Trigger (Touch Event)
    2. Event Type (Tap)
    3. Touch Target (Keep it empty)
    4. Allow (Here you select how this should work everyy time you tap or only once)
    5. Delay (Start from 0 when this action should start)
    6. Response type (Play video) -> Then (Add the video)
    7. Then you have the action to select bewteen play, pause, or resume etc..

    I hope that helps and if you mean something else I would be happy to help and understand your issue more.

Answers

  • A Square Devs
    A Square Devs Posts: 3
    edited April 2023 #3
    Options

    @Tariq B said:
    Hello there!

    If I understood you right, I would suggest you use just a simple use of Behavior Script

    Let's say when the user tap on screen it goes from frame 0-100 and it takes for example 4 seconds.

    Then Simple, you can go to Behavior Script to do the following:

    1. Trigger (Touch Event)
    2. Event Type (Tap)
    3. Touch Target (Keep it empty)
    4. Allow (Here you select how this should work everyy time you tap or only once)
    5. Delay (Start from 0 when this action should start)
    6. Response type (Play video) -> Then (Add the video)
    7. Then you have the action to select bewteen play, pause, or resume etc..

    I hope that helps and if you mean something else I would be happy to help and understand your issue more.

    Thank you. This appears to work. Seems way simpler than I would have expected it to be lol.

    Edit: It is kind of lame that it seems like I need to make duplicates of the video for each effect so that they don't play the video at the same time, but gotta do what you gotta do. Still smaller files than if I rendered each layer with it's own scrolling effect though.

  • Tariq B
    Tariq B Posts: 96 🔥🔥
    Options

    I am glad that helps, Actually is the best way to do that how Snap Team worked hard to make this process become easier.