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.