Why is my nikon D5100 not auto focusing?
Like when I press the shutter button halfway, why doesn't it focus?
Added (1). It has always been on the A side.
On the side of the lends there's a swats that say "a" and "m" A is auto focus and m is manual focus set it to set it to a
There are two ways to turn the auto focus off in a Nikon. The other is in the camera menu's. Might you have changed that somewhere?
I'm assuming you are using an AF-S lens?
Sometimes in dark rooms DSLRs will not focus as there's not enough light. Or even if you are trying to focus say on distant clouds as cameras also require some contrast in the scene to focus.
This is not unique to the D5100, but it is pretty much a characteristic of all cameras.
Take it out into the daylight and see if it focuses OK.
Are you using an AF-S lens, one with an internal auto-focus motor?
Older AF lenses have to be manually focused using your D5100. Inside the viewfinder there's an electronic rangefinder you can use to assure good focus manually
You're too near.
Light too dim.
Light not enough.
Contrast not enough.
Battery low.
Camera off.