No matter what I try, the function just doesnt work for me. It either rotates the wrong axis, doesnt rotate at all, just jitters randomly or the whole object gets another position? I seriously dont know what Im doing wrong.
void lookAtTarget()
{
Vector3 targetVec = target.transform.position;
Vector3 ownVec = transform.position;
baseTop.LookAt(new Vector3(0, 0, targetVec.z), Vector3.forward);
}
Im trying to rotate it on 1 axis only, right now it takes a different position and rotates on the wrong axis. Ive tried every combination of direction, constraints etc etc. Please Im getting so annoyed by this.