Update tutorials/scripting/instancing_with_signals.rst

Co-authored-by: Paul Joannon <437025+paulloz@users.noreply.github.com>
This commit is contained in:
Raul Santos
2023-07-13 12:17:19 +02:00
committed by GitHub
parent 19fccc0bd5
commit d9e888744e

View File

@@ -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)
{
var spawnedBullet = (Bullet)bullet.Instantiate();
var spawnedBullet = bullet.Instantiate<Bullet>();
AddChild(spawnedBullet);
spawnedBullet.Rotation = direction;
spawnedBullet.Position = location;