Hello all, I am trying to make a 2 D game like space invaders. I wanted to have the enemies make a circle around the player and rotate around you. so like imagine a clock with you at the center and each number is an enemy. The problem I am having is I want the enemies to shoot at the player but I can not find a way to make this work. I have a bullet script that does this to move the bullet:
transform.Translate(Vector2.up* Time.deltaTime * speed);
the problem i am having is finding the right angle to set the bullet to when it spawns so it moves towards the player. I have tried all sorts of things from vector2.angle, to messing around with eulerAngles and loads of other things. I have this
shotDirection = -(transform.position - player.position);
Debug.DrawRay(transform.position,shotDirection, Color.red);
which draws a ray from the bullet to the player and seems like it would work perfectly. But I cannot make the bullet angle itself to match that! please help and thank you!