Browse Source

Update tutorials/scripting/instancing_with_signals.rst

Co-authored-by: Paul Joannon <[email protected]>
Raul Santos 2 years ago
parent
commit
d9e888744e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tutorials/scripting/instancing_with_signals.rst

+ 1 - 1
tutorials/scripting/instancing_with_signals.rst

@@ -149,7 +149,7 @@ In the main scene, we then connect the player's signal (it will appear in the
 
 
     private void OnPlayerShoot(PackedScene bullet, float direction, Vector2 location)
     private void OnPlayerShoot(PackedScene bullet, float direction, Vector2 location)
     {
     {
-        var spawnedBullet = (Bullet)bullet.Instantiate();
+        var spawnedBullet = bullet.Instantiate<Bullet>();
         AddChild(spawnedBullet);
         AddChild(spawnedBullet);
         spawnedBullet.Rotation = direction;
         spawnedBullet.Rotation = direction;
         spawnedBullet.Position = location;
         spawnedBullet.Position = location;