Why does the tower canon not rotate towards the enemy

public class Target : MonoBehaviour

{

 [SerializeField] Transform weapon;

[SerializeField]Transform target1;



void Start()

{

    target1 = FindObjectOfType<Enemy_Mover>().transform;

}



void Update()

{

    AimWeapom();

}

void AimWeapom()

{

    weapon.LookAt(target1);

}

}

This is the exact same code but my tower canon doesnt rotate towards the walking enemy and I cant figure out why. Can someone help me?

You posted in Blender courses section. You should probably post in the appropriate section for your course to get help.

Privacy & Terms