I want object, when spawned, to turn and travel towards my enemy object. I've already got the travel working but the rotation towards the enemy doesn't seem to work.
Here's my current code:
GameObject newRocket = GameObject.FindGameObjectWithTag("Enemy");
direction = (cil.transform.position - novaStrela.transform.position);
rotationDirection = Quaternion.LookRotation(direction);
newRocket = Instantiate (rocket, transform.position, rotationDirection) as GameObject;
newRocket.rigidbody.AddForce ((target.transform.position - transform.position).normalized * projectileSpeed);
I know it's a bit of a mess, but I would be glad if you help me. Thank you so far