Does the video stream player always load itself? In my game scene I created an area block that, on a body being entered into it, calls a control node scene containing a video stream player. In control node script I use the _on_video_stream_player_finished to call back the game scene.
Because I think the video stream player keeps playing on the background it keeps reloading the game scene even when nothing has caused it to play.
For more information I have enabled autoplay because or else the video doesn’t seem to play
Here the player is on the left. So here it appears to have no issue cause I interacted with the pumpkin. But even if I don’t the video stream is being run on the background so it’ll reload the scene anyway as show here:
But even if I don’t the video stream is being run on the background
when that happens, please go into the Remote tab’s SceneTree and see how it looks like there. Do you have game.tscn AND memory.tscn inside the SceneTree at the same time?
I’d put a breakpoint right before get_tree().change_scene_to_file("res://scenes/game.tscn") and then go from there.
So my question is how do I make the video play only once when the player interacts with the pumpkin?
From your situation here, you remove the entire game scene to change into the memory, then recreate the game scene after the memory is over (which causes the funny camera panning).
The easiest workaround to making the pumpkin only play once is to make use of a global Autoload. Maybe call it “Global” or something. Inside the autoload, you can create variables like var has_seen_memory: bool = false
Then on your memory_cutscene script, you can go with this:
func _on_area_entered(area: Area2D) -> void:
if area == character.area_2d:
if Global.has_seen_memory == true: return
Global.has_seen_memory = true
print("Showing cutscene")
[...]
when that happens, please go into the Remote tab’s SceneTree and see how it looks like there. Do you have game.tscn AND memory.tscn inside the SceneTree at the same time?
This seems to have highlighted my issue. I kept the memory.tcsn hidden in some node group hence why it was loading in the background. I removed it and now its working fine and only loads when interacting with the pumpkin. Thank you so much!