How can I use a sprite as a projectile.


I am currently using a line renderer to show a “bullet.” I was wanting to figure out instead of using a line renderer could I use a sprite renderer to be able to fire a sprite(eg. an arrow)? Or what is a good way to be able to use a sprite as a projectile?


Just make your sprite a prefab and tell the player to shoot that prefab every time he shoots. Something like this:

public float spawnTime = 5f;
//The amount of time between each spawn.
public float spawnDelay = 3f;
//The amount of time before spawning starts.
public GameObject[] shots;

//Array of enemy prefabs.
public Vector3 enposition;
void Start ()
	//Start calling the Spawn function repeatedly after a delay.
	InvokeRepeating("Spawn", spawnDelay, spawnTime);
void Spawn ()
	int shotIndex = Random.Range(0, shots.Length);
	Instantiate(shots[shotIndex], enposition, transform.rotation);