Yes, debt consolidation can affect your credit score. However, if you go about the process as advised by professionals, the negative effects will be temporary and you will soon see your credit go back to normal.
Adding a new account in the form of a loan lowers the ages of your existing accounts, which can lower your credit score a bit. You’ll also be using a higher percentage of your credit, which is another ding to your credit.
However, you can build up your debt consolidation over time because it enables on-time payments and will help you get to a lower credit utilization.