Rotate projectile sprite in the direction it is flying (like an arrow) 2D.

Hi guys,

This questions seems to have been answered here a few times but the solutions dont work for me for some reason and I wanted to just post my issue here see if maybe I can clear this up.

I have a monster in my 2d game, when a player enters his collider he fires a projectile at time. Simple. However the spite of the fireball is always facing right. so although it flys in the correct direction, the sprite is facing the wrong direction.

here is my script to shoot at the player:

public void OnCastComplete()
    {
        Rigidbody2D projectile;

        projectile = Instantiate(fireball, projectileInitialLocation.transform.position, transform.rotation) as Rigidbody2D;

        projectile.transform.LookAt(currentTarget.transform);

        projectile.velocity = projectile.transform.forward * projectileSpeed;
    }

thank you for your input.

Found the problem, Because my game has a camera that looks at a 25 degree angle or there about down onto the world each sprite has a script like this on it:

public class FaceCamera : MonoBehaviour {

    public Transform target;

	void Start () {
        target = GameObject.Find("MainCamera").GetComponent<Transform>();
	}
	
	void Update () {

        if (target != null)

            this.transform.rotation = Camera.main.transform.rotation;
    }
}

this was causing the issue.

the next question now is. How do I make the sprites face the camera like the do in this script but at the same time rotate only on their z axis when flying towards their target. because that would work.