Hi everybody
I’m using a Gizmos.DrawSphere to draw on my scene the area where my monster can move.
To draw my sphere i’m using:
void OnDrawGizmos()
{
Gizmos.color = Color.yellow;
Gizmos.DrawSphere(transform.position, 2);
}
and to get a pos for my monster :
Vector3 postest = spawnPos + new Vector3(2, 0, 2);
In my script above, I put the value of “2” for the size of the sphere, and also in X and Z for my monster.
With that, I expect to have my monster at the edge of the sphere.
But not at all …
Here what I have:
Just in case, The “spawnPos” is the Guizmo object…
If someone can explain to me what is happening?
I tried with bigger valu and the result is the monster always goes 30% further than the edge of the sphere…
Thanks for helping me!
Have a good day!