20. Build a Play / Restart Button
The embedded Video element does not have dedicated shared Play GUI Video / Pause GUI Video action types in this build. A small GDScript wrapper can control its actual player. Create a script record with ID play_video:
extends "res://scripts/runtime/script_base.gd"func run(_context: Dictionary = {}) -> Variant:
var player := GetGUIElementProperty(
"video_lab", "briefing_video", "video_player", null
) as VideoStreamPlayer
if player == null or player.stream == null:
return false
player.paused = false
player.play()
return true1. Apply Changes to the script.
2. Add a Button with the caption Play / Restart.
3. In Events, set Click to run-visual-script and Click Target to play_video.
4. Start a running game preview, open the GUI and press the Button.
The behavior name run-visual-script can run this GDScript record too. You can also use the shared script-running action that offers the project’s script records.
player.play() starts playback from the beginning. Resuming a paused movie uses a different operation, explained next.
