Hi. I already posted about the similar problem with LookAt which unfortunately didn’t get solved , but i’m working on it. Now let’s get onto the problem. I am having 2 ball characters in the scene . One is the main character (left one) and right is Enemy. Enemy is programmed to shoot from the guns every few seconds at the player , but there’s one problem. I’m using this line to get the enemy “Look At” me.
transform.LookAt(target.transform.position);
Where the target is Transform.
Now what happens is something really weird. The other ball character isn’t looking at the object , but it’s flipping around in weird position. And when i move over it it kinda follows me but not with the “Front” side. It also always shoots where i am. So my question is how to set up the LookAt of my enemy so it looks with it’s front side exactly at me , and then i guess i can use Slerp for it to follow me around and shoot at me. Here are some pictures. P.S : I tried adding , Vector3.up and any other vector.direction line to the LookAt come but nothing worked out.
This is the picture of how the ballis “Looking At Me” while playing
And this is the picture of ball in the scene , facing the way it should face while playing aswell
Any help is really appreciated because alot of time was spend in the project so far and this simple problem is stopping me for going further