Forum rules - please read before posting.

Using video instead of frame animation as speaking Character Portraits

Yeah. So I can't seem to find an easy way of doing this.
What I basically want to show is play a looping video of the speaking character during their dialogue.

Comments

  • edited December 2018

    Welcome to the community, @DragoonHP.

    You can currently assign a MovieTexture as a character's portrait graphic, but it will not play back automatically. I will implement this in v1.66.1 - thank you for the suggestion.

  • Thanks for the quick response Chris.
    Do you have a general idea o when it will be released?

    Also, until then, is there any other way of doing this?

  • You should be able to achieve this by pasting the following into the MenuGraphic.cs script:

    public override void OnMenuTurnOn (Menu menu)
    {
        PreDisplay (0, Options.GetLanguage (), false);
    
        if (localTexture != null)
        {
            MovieTexture movieTexture = localTexture as MovieTexture;
            if (movieTexture != null)
            {
                movieTexture.Play ();
            }
        }
    }
    
  • Thanks a lot :)

  • edited December 2018

    Two more question:

    • The video isn't playing. I see a frame from the middle of the clip and that's it. I added the bit of code you provided me on Line 312
    • Unity is complaining about MovieTexture being deprecated and to use VideoComponent
  • If you're using 2018.2 or later, then yes - Unity are deprecating MovieTextures. Did you set your video's texture type to "Movie Texture"?

    To make use of Unity's new VideoPlayer system, you'd need a separate script such as this:

    http://pasteall.org/1442365/csharp

    Attach this to your character's root, and assign their associated "speaking video clip" in the Inspector.

    When that character speaks, the script will then search for a VideoPlayer component attached to a GameObject named "SpeechVideoPlayer". If you switch your Subtitles menu to Unity UI, you can add such a GameObject onto the UI Canvas and give it a VideoPlayer component.

  • Did you set your video's texture type to "Movie Texture"?

    I don't think I saw any option for that.

    Video Object

    Render Texture

    Dialogue Settings

    Subtitle Settings

    If you switch your Subtitles menu to Unity UI, you can add such a GameObject onto the UI Canvas and give it a VideoPlayer component.

    How would I do this? I have already chosen AC UI in the start.

  • I don't think I saw any option for that.

    The option should be in the Inspector for the clip itself, i.e. "Nine Inch Nails"

    How would I do this? I have already chosen AC UI in the start.

    If you're relying on the default AC menu set, then you can switch each of the provided menus to rely on Unity UI instead via the Source property within the Menu Manager.

    Setting this to Unity Ui Prefab will then list its associated Canvas below. In the case of the default Subtitles menu, it's SubtitlesUI - which you can add the VideoPlayer to.

    For more on "Unity UI menus", see the Manual chapter by the same name.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.