I have an issue like in this previous thread were my projectile is going the opposite direction and not hitting the player.
in this thread problem was solved by turning isKinematic off I believe, but in my case I have had this turned already from previous steps when Ben hinted on us to do that.
My rotation on projectile is all (0, 0, 0)
my code for spawn projectile is as follows (cross checked with video, and I do not see any differences)
void SpawnProjectile()
{
GameObject newProjectile = Instantiate(projectileToUse, projectileSocket.transform.position, Quaternion.identity);
Projectile projectileComponent = newProjectile.GetComponent<Projectile>();
projectileComponent.SetDamage(damagePerShot);
Vector3 unitVectorToPlayer = (player.transform.position - projectileToUse.transform.position).normalized;
float projectileSpeed = projectileComponent.projectileSpeed;
newProjectile.GetComponent<Rigidbody>().velocity = unitVectorToPlayer * projectileSpeed;
}
I cannot for the life of me pinpoint what causing this issue. As I have re-watched the lecture a couple of times now, and following every step to the sot while still getting this issue.