Hi
Problem is you are comparing two different things.
eg : Vector3(0,50,0) cannot be compared to 10.0f
but you can definitely compare 5 >=10 because the values are of same type.
if you want to compare distance in x axis do the below code
if(playerCharacterManager.transform.position.x <= attackDistance)
{
AttackAI ();
}
Hope I am able to make my point clear.
↧