-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
I'm trying to instantiate a PackedScene into a GodotWindow
let loadScene = { (subwindow: Window) -> () in
if let scene: PackedScene = GD.load(path: "res://scene_2.tscn") {
if let node: Node = scene.instantiate() {
subwindow.addChild(node: node)
}
}
}
struct ContentView: View {
@StateObject var app = GodotApp()
var body: some View {
VStack {
GodotAppView()
GodotWindow(callback: loadScene)
}
.padding()
.environmentObject(app)
.onAppear(perform: {
app.createInstance(scene: "main.pck")
})
}
}
but it causes GodotAppView to change its scene to scene_2.tscn as well.
Is there a way to run multiple scenes that are packed into a .pck file?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels