Game won't unpause after a cutscene?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By stella3321

Ok bear with me,

I tried to add in a cutscene in my game and I thought I could base it off of the same code that I used for the Pause menu. So I created a control node with a videostream player and a short animation and when the player picks up an item they receive the signal “Glitch effect” and the cutscene plays and when the video is over the player can go back to the regular game.

This is my code for the cutscene:

extends CanvasLayer
signal GlitchAccomplished


extends Control

var is_paused = false:
	set(value):
		is_paused = value
		get_tree().paused = is_paused
		visible = is_paused

func _on_glitch_effect():
	self.is_paused = !is_paused
	$AnimationPlayer.play("begin")
	$VideoStreamPlayer.play()

func _on_Cutscene1_finished():
	$AnimationPlayer.play("end")
	self.is_paused = false

Here’s the thing, the game pausing, the cutscene starting and video playing when the player picks up the item all work perfectly fine. And when the video is over, I do get back to the game itself, but the character is frozen and I can’t do anything.

The weirdest thing is my Pause Menu works perfectly fine this is the code for that:

extends Control

var is_paused = false:
	set(value):
		is_paused = value
		get_tree().paused = is_paused
		visible = is_paused

func _unhandled_input(event):
	if event.is_action_pressed("Pause,quit"):
		self.is_paused = !is_paused
		
func _on_resume_pressed():
	self.is_paused = false

func _on_quit_pressed():
	get_tree().quit()

And I cant figure out why that one unpauses perfectly but the cutscene doesnt

set up print() in various lines of this code. You need to check if setget is triggered, or perhaps animation end signal is not reaching.

Inces | 2023-07-01 11:48