Hey there! I'm trying to render a scene as a transparent overlay atop of another scene using a viewport. I have gotten it to properly display my chosen scene, however, I am having difficulties getting it to switch scenes from any other scene besides the first one I had initially loaded.
Here is my code:
func _preview(timeline, state):
preview.visible = true
var current_time = load("res://Resources/Nodes/Scenes/Levels/"+ Level +"/Timelines/" + timeline as String + ".tscn").instance()
var rtt = viewport.get_texture()
preview.get_node("Container/Sprite").texture = rtt
last_preview = current_time
This function is called whenever the player presses Q or E, and the timeline variable is always a number 1-5 (Which corresponds with the name of the scene it's loading)
Here's my node hierarchy!
Here is an example of it in action, but with numbers 2-5 not working