Sure that's ok
also
While taking a walk, James bumped into a pillar and hit his head.
While taking a walk, James bumped into a pillar and hit his head on it.
While taking a walk, James walked into a pillar and hit his head.
.
bump into - is soft, not implying any damage, so it's not always a natural for a guy walking into a lamppost.
.
Blindfolded as he was, he bumped into the table, three chairs and the sofa but it was triiping over the coffee table that took him down.
.