Ejemplo n.º 1
0
    void FixedUpdate()
    {
        currentPos  = rbody.position;
        inputVector = new Vector2(direction.x, direction.y);
        inputVector = Vector2.ClampMagnitude(inputVector, 1);

        speed = movementSpeed;
        if (isTalking)
        {
            speed = 0;
        }

        movement = inputVector * speed;
        newPos   = currentPos + movement * Time.fixedDeltaTime;
        isoRenderer.SetDirection(movement, isTalking);
        rbody.MovePosition(newPos);
    }