Skip NPC Cinematic with Interactive Key


Author: Carlos Castro

For today’s blog, I am going to explain how to skip a cinematic that you activated with the same key. This is because in our game The Butterfly Effect inside level 1 the player is able to interact with an NPC. this NPC gives a hint to the butterfly playing a cinematic and displaying a text. But what happens if the player wants to skip the cinematic when the cinematic is been played? 

This is when I was getting issues. When the player was interacting with the NPC to play the cinematic my first thought was to create a simple bool variable so if the player played the cinematic then if the player can skip it is going to be with the same interactive key. But what was happening is that the cinematic started playing and then without the player pressing the interactive key it was getting skipped. 

To Solve this situation I had to create a  few changes. First I added a Delay, this means that the player presses the interactive key, then the cinematic is going to start playing, and then is going to have a delay of 0.1 seconds. This means that in that specific frame, the player didn’t press the interactive key to turn off the NPC cinematic. 


But this is not the whole solution, then I had to jump into the NPC code and blueprint. Inside the code, I just added a simple event that can be called in blueprints to stop the cinematic (Let’s remember that playing or stopping the cinematics in C++ causes bugs during gameplay). With that stop cinematic event, I can check if the skip NPC cinematic bool is true, if it’s true then I just take the cinematic that is been played and I stop that cinematic. 


Now, we have almost all the solutions. Now the player can skip the cinematic without issues. But there is one last step. I have to tell the player what is the key to skip the cinematic. For this last part, I had to jump into the UIHUD. There I had to review the Visibility function for the text and for the image. If the NPC cinematic is active then I want to show the text if it’s false then I want to hide it.

I did this process for the image and for the text and with this process done we can skip the NPC cinematic using the same interactive key and show the player during gameplay what key they have to press to skip the NPC cinematic. 

Leave a comment

Log in with itch.io to leave a comment.