What's the difference between “use @export packedScene” and “use preload scene”

Godot Version

4.2.2

Question

I found two way to import scene for instantiate。What are the differences between the two way?

1. use @export var scene: PackedScene

2. use preload

No difference. The @export simply allows you to preload/initialize from the Inspector. As a matter of fact you can add @export to the 2nd screen shot and will notice that the scene path is shown in inspector as well.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.