NodeCanvas Forums › Support › [BUG] Wander.cs
In Wander.cs looks like squared min needed because comapared vs sqrMagnitude?
min
sqrMagnitude
while ( ( wanderPos – agent.transform.position ).sqrMagnitude < min ) { wanderPos = ( Random.insideUnitSphere * max ) + agent.transform.position; }
Hello,
Hmm. This is exactly how the code actually is right now (same as the one you posted).
Can you please clarify your change (or do you by any chance use an old version) ? Thank you.
Join us on Discord: https://discord.gg/97q2Rjh
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; }
Oh.. you are right. Thanks for the fix. Apparently I missed that 🙂
Username
Password
Remember Me
By registering on this website you agree to our Privacy Policy.
Email
Confirm Password
Username or Email