I’m making a 2d top-down rpg, and i have a spell. I made a sprite with icebolt image, but im not sure how i can shoot the sprite multiple times, so that there is 2 or more icebolts in the game at a time
Instantiate is what you are looking for. You need to create (Instantiate) a new gameobject every-time you shoot.
Here is an example code:
public class PlayerController : MonoBehaviour
{
public GameObject bullet;
// More methods
public void Shoot()
{
// Do some checks
GameObject new_bullet = Instantiate<GameObject>(bullet);
// Do some more things
}
// More methods
}
Your player controller (or whatever you are named it) should look something like this.