Praying is not enough to get closer to God. Praying which is eact of communing with God, is one of the ingredients needed to get closer to God. Some people pray amiss, i mean pray wrongly and such prayer has no link with God. There are rules guiding prayer. For example, for one to pray an acceptable prayer, one has to repent of Ones sins, because the bible says that the prayer of a sinner is like a filthy rag before God. Too, one has to obey the commandments of the lord before one's prayer is accepted unto God. There is also hypocritical prayer as shown by the pharisee who went to pray in the temple with the publican at the hour prayer in Luke 18:9-14.
The pharisee's prayer was not accepted because, he was biased in his prayer, it was rather the public that was justified because he showed remorse in his approach. Prayer is not enough to get closer to God, it has to go along with obedience, righteousness, humility, purity, clear conscience etc.