If you have unpaid student loans and are in default of your student loan payments then yes it will affect you getting a mortgage.
But if your student loans are being paid back on time and you don't miss a payment then the student loan shouldn't affect a banks decision when deciding whether to give you a mortgage.
As long as you have enough income and your credit score is good and you have the down payment then you should be able to get the mortgage.