[BUG] Wander.cs

NodeCanvas Forums Support [BUG] Wander.cs

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #15053
    anton petrov
    Participant

    In Wander.cs looks like squared min needed because comapared vs sqrMagnitude?

    while ( ( wanderPos – agent.transform.position ).sqrMagnitude < min ) {
    wanderPos = ( Random.insideUnitSphere * max ) + agent.transform.position;
    }

    #15059
    Gavalakis
    Keymaster

    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

    #15064
    anton petrov
    Participant

    I made no changes – I posted exactly your code. But I think it must read min * min.

    Like this:

    var sqrMin = min * min;
    while ( ( wanderPos – agent.transform.position ).sqrMagnitude < sqrMin ) {
    wanderPos = ( Random.insideUnitSphere * max ) + agent.transform.position;
    }

    #15080
    Gavalakis
    Keymaster

    Oh.. you are right. Thanks for the fix. Apparently I missed that 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.