@@ -349,7 +349,7 @@ first one is to load the scene from your hard drive:
.. code-tab:: csharp
- var scene = (PackedScene)ResourceLoader.Load("res://myscene.tscn"); // Will load when the script is instanced.
+ var scene = GD.Load<PackedScene>("res://myscene.tscn"); // Will load when the script is instanced.
Preloading it can be more convenient, as it happens at parse
@@ -270,7 +270,7 @@ Here is the code for the player using signals to emit the bullet:
[Signal]
delegate void Shoot(PackedScene bullet, Vector2 direction, Vector2 location);
- PackedScene _bullet = (PackedScene)GD.Load("res://Bullet.tscn");
+ PackedScene _bullet = GD.Load<PackedScene>("res://Bullet.tscn");
public override void _Input(InputEvent event)
{