0
\$\begingroup\$

My sister is working on a visual novel. We wanted to use unity to build it. She wants to have videos with clickable buttons to skip to other scenes. The problem is we both are noobs! Do you guys have any tips on tutorials or anybody knows if this is possible? What would be the best method to tackle this.

I figured having each scene as an mp4 and having buttons trigger each mp4. but, how would that work with time-triggered Audio?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ I provided you with an answer, but you should know that Unity is a bit oversized for a visual novel. The only reason to use Unity for this purpose is if you know Unity very well but don't know any of the more appropriate engines which are specifically made for visual novels. Like Ren'Py, Tyrannobuilder or VN Maker, for example. If you don't know much about Unity and don't see this as a learning exercise to learn Unity in particular, then you might want to reevaluate your technology options. \$\endgroup\$
    – Philipp
    Jun 11, 2020 at 12:22
  • \$\begingroup\$ This is the kind of question that should first lead you to a search engine to research available tutorials for working with videos in Unity, working with UI buttons in Unity, working with audio in Unity, etc. Break down your problem into smaller parts, then go learn more about each part until you're able to make a small test with it. If you run into a snag - your test doesn't work the way it seems like it should from the documentation/guides you've researched, then that's a good time to ask here, with a specific problem where you can show your work so far. \$\endgroup\$
    – DMGregory
    Jun 11, 2020 at 12:34
  • 1
    \$\begingroup\$ Please don't "UPDATE" your question to turn it into a different question, after it already has an accepted answer. If the existing answer doesn't solve your problem, post a new Question. You can avoid excess question churn by doing your own research and experiments in advance, so you narrow down the real crux of the issue you need help with before posting the question. \$\endgroup\$
    – DMGregory
    Jun 11, 2020 at 14:59

1 Answer 1

0
\$\begingroup\$

The component you are looking for is the video player. It handles both video and audio playback.

If you want to play the video full-screen, then I would recommend to set the render mode to "Camera Near Plane". If you want to play the video in a window, then I recommend to use "Render Texture". This requires that you create a render texture asset to render to. That render texture can then be used as a texture for a quad or sprite in your scene or a RawImage on your UI canvas.

The documentation I linked to should tell you further details.

If you have multiple video clips which you want to play through the same video player, then you should deactivate "Play on Awake" on the video player and control the playback through a script. That script needs to:

  1. set the correct video asset on the player (the .clip property)
  2. call the Play() method of the player to start playback

The scripting documentation of the VideoPlayer class should give you more information on what else you can do with it.

\$\endgroup\$
3
  • \$\begingroup\$ Thank you Phillip! I have made the first clip playing through the video player object. since I am a bit new do u know how I would go create a button to swap to a new clip? \$\endgroup\$
    – user140446
    Jun 11, 2020 at 13:49
  • \$\begingroup\$ @user140446 This is something which is very simple if you know the basics of the Unity UI system. I could take an hour to write you a basic rundown, but others have already explained it much better than I could. So please look up a basic Unity UI tutorial. \$\endgroup\$
    – Philipp
    Jun 11, 2020 at 14:27
  • \$\begingroup\$ Thanks @Phillip! so far I have created buttons to make it "pause" and "play" what function do I need to assign to the button to make it play another movie filled? I appreciate all the help and time my kind sir! \$\endgroup\$
    – user140446
    Jun 11, 2020 at 14:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .