Forums › 💬 NodeCanvas › ⚙️ Support › [BUG] Wander.cs › Reply To: [BUG] Wander.cs
I made no changes – I posted exactly your code. But I think it must read min * min.
min * min
Like this:
var sqrMin = min * min; while ( ( wanderPos – agent.transform.position ).sqrMagnitude < sqrMin ) { wanderPos = ( Random.insideUnitSphere * max ) + agent.transform.position; }