Create a skip cutscene button in Unity.

Objective: create a UI Button and skip and change the time in the timeline at the end of the cutscene.

First step is to create a UI Button, in this case I placed it in the right button corner.

Then we have to create a new C# script. I called it TimelineController and added it to the Intro Cutscene gameobject.

In the timeline controller script we have to use the namespace UnityEngine.Playables in order to access the functions in the playable director. I created a variable to store the reference of the playable director of the intro cutscene and a function that receive the time mark to set in the timeline. In this case we are gonna pass a value around the end of the cutscene.

After that, we have to select the button and in the inspector we have to add 2 actions in the “OnClick” section. First we have to call the function in the intro cutscene to set the new time and skip the shot. The other action is to disable the skip button to avoid the player pressing it multiple times.

And that’s it!!! We have a functional skip button for our cutscenes.

--

--

--

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Finding the best Web-Browser in 2019

Deep Dive into My New Website

Daniel Yuschick in Hang En Cave taken by @nome_sapien

It was, in the words of Dr. Daniel Jacobson lead researcher and chief scientist

Newly-Introduced JUnit 5 Annotations and Classes. Tagged tests

Three essential add-ons for flexible, easy-to-edit nonprofit websites

Simple steps to enable CORS in API Gateway through console/cloud formation

Amazon Redshift via CLI

Teach kids art of Debugging using Graph Paper Programming

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rusben Guzman

Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.

More from Medium

How to Create a Custom Hand Painted Skybox

Adding a Main Menu to our UI

Creating Coin Distraction Feature in Unity (Part 1)

Racing Car Game # Day 8— Main Menu & Loading Screen