#Intro Cutscenes...

8 messages · Page 1 of 1 (latest)

faint tide
#

how do i make a intro cutscene that after playing the cutscene the title screen will appear?

its like after a videoplayer is done playing, the scene changes to another scene

fossil jackal
#

Exactly how you said it

woven temple
#

More specifically, I'd make a script to attach to the intro cutscene scene. Attach the video player's finished signal to a function that transitions to the main menu scene. This way you can also call that transition function via a keypress so the player can skip it.

faint tide
woven temple
# faint tide oh, so what would the code be like?

I wrote this up quickly, you might need to tweak it a bit. Make a VideoStreamPlayer node as a child of the root Control node attach this script to the root:

extends Control

func _ready():
    # Connect the "finished" signal to the transition function
    # You could also do this in the editor by selecting the VideoStreamPlayer
    # node, going to the "Node" tab on the right side, and clicking the 
    # "finished" signal
    $VideoStreamPlayer.connect("finished", "_on_cutscene_finished")


func _input(event):
    # If player presses a key defined in the input map named "skip_cutscene",
    # call the cutscene transition function
    if event.is_action_pressed("skip_cutscene"):
        _on_cutscene_finished()


# Function to change this scene to the main menu
func _on_cutscene_finished():
    change_scene_to("res://path/to/main_menu.tscn")