So i’m new to unity, and i’m trying some things before going for a Tower Defense game.
I checked the LookAt function with a camera pointing a simple object(like cubes), and it works fine. I also tried with simple objects facing other simple objects.
Then, i make a “Enemy” which is composed by cubes and spheres, and a “Tower” which is made from cylinders and spheres. The tower is divided on two parts: base and top, and top part should face the Enemy.
Here is the “fail”. When i use the LookAt function, if i move the Enemy, the tower starts doing an orbit-like move too, instead just facing the enemy. Then i try the same thing with a simple object facing the enemy, and it works, but i observe that the object looks to a point which is different to the actual position of the enemy. Like if enemy has a “real” position and a “fake” position.
I confirmed this by adding a sphere collider to enemy, and -what a surprise- it appears just at the point i mentioned.
Why this happens?