For some reason player doesn’t move in the middle of the block, but stops when reaches the side of the block.
FindBlockToMove() is just a spot, but it has a child visual object with a collider. player is also just a spot and it has a child visual object. Visual objects of player and block are not touching.
Why can it happen and what should I do to make player move in the middle of the block?
And it happens both with MoveTowards and with Lerp
private void MoveToChosenBlock()
{
GameObject _blockToMove = FindBlockToMove();
Debug.Log($“Now we move to {_blockToMove}”);
float _moveDistance = _moveSpeed * Time.deltaTime;
Vector3 _blockPosition = FindBlockToMove().transform.position;
transform.position = Vector3.MoveTowards(transform.position, _blockPosition, _moveDistance);
//transform.position = Vector3.Lerp(transform.position, _blockPosition, 0.1f);
}