Ray lenght

Hi guys,

I was following this tutorial http://unity3d.com/learn/tutorials/projects/stealth/enemy-sight?playlist=17168 to make my own AI script but there is something that I don’t understant : like in the tutorial, I wrote this in my code :

if(Physics.Raycast(myTransform.position + myTransform.up, direction.normalized, out hit, mySphereCollider.radius))
     //Code to follow the player

But when I tested in game, the AI follow when my player is very close from the AI even the sphere radius is pretty big.

So I did a DrawRay debug and a log to see the sphere raidus to see what is going on and I had something very strange (see the image bellow) but the console log say that mySphereCollider.radius is equal to the sphere radius on the gameobject that I see on my editor.

Any scaling on your game objects? That can affect it too.

Thx !

Indead I scaled my AI, the withe think, on the Y axis and it affected the sphere without changing the radius.