#I don't see any Move False or Move True

1 messages · Page 1 of 1 (latest)

kindred stag
#

It did run. The first three lines show the problem. Only Debug.Log in Handle get called. Updated code:

public void Handle(Func<bool> func)
{
    if (_doneFlag) return;
    _timer += Time.deltaTime;

    Debug.Log("In Handle before call Move()");
    bool done = func();
    Debug.Log("In Handle after call Move()");
    Debug.Log("In Handle and return " + done);
    if (done && (_behaviorPath.GetCurrentAction().ActionDuration() < _timer))
    {
        _doneFlag = true;
        _doneAction = true;
        _timer = 0f;
    }
}

public bool Move()
{
    Debug.Log("First Line In Move");
    if ((transform.position - _destination).magnitude < _stopDistance)
    {
        if(!_navMeshAgent.hasPath && _navMeshAgent.velocity.sqrMagnitude == 0f)
        {
            Debug.Log("In Move And Should Return True");
            return true;
        }
    }
    Debug.Log("In Move And Should Return False");
    return false;
} 
#

Sorry, I missed clicking something, and it created this.

warm sun
kindred stag