

Once you have this setup we need to create a GDScript called projectile. You will want to replicate this node structure to make it work. So go ahead an create a new scene and save it as Projectile.tscn. To get this working we are going to start off with a new scene where we can create a bullet sprite and some bodies to allow us to shoot our bullet at a velocity. I created a very basic rectangle image which we will use for our bullet. To spawn a bullet we first need a bullet. Godot Spawn Object: Godot spawn bullet sprite So let’s jump into making godot spawn a bullet.

Let us create a way for our player to shoot a bullet. Let’s do something a little more fun now. So if you have done this correctly you should end up with. You can go ahead and attach this to your Game node as a script like so. We are now going to modify this script to. When you open it up you should have this. Ok so now on the FileSystem right click and create new script. Once done we can now add a script for spawning our player, but first before we do that hit play to just check that the screen is showing blank and that the game.tscn is the main scene. Which at this point will only have a Node2D which I renamed to Game. Now we going to create a new scene called Game.tscn. Once you have that save your player as Player.tscn. So you can just replicate what I have below. So for simplicity sake I have given my player a KinematicBody2D and CollisionShape2d for when we expand our project further. For this I am going to use the basic player icon.png in most godot projects when you first create your project. To spawn a player in godot we need to just start by setting up a player scene which we can use.
