LookAt huge problems

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 :slight_smile:

i had similar issue but might be unrelated, but after hunting for a while, i came to the conclusion that my axis on the object where wrong because of a blender import. and since i could not figure out for the life of me, i just created empty objects in unity and made them parents of the fbx obj. local and global position screwed with my head for a while. hope it helps or gives new ideas

If you can access the original model, you should be able to fix the problem by rotating the X pivot by 90 or -90. I forget which.

When you import the model, the rotations should all be zeros. I can see you have 270 in you x which is probably whats causing the problem.

If you cant access the model, do as suggested and make it a child of an empty game object.