The problem might be with the camera body, the lens, or the interface between the two.
In case it's the latter, the following might be a quick fix:
Detach / reattach the lens: turn off the camera, depress the lens release button and rotate the lens clockwise until it detaches. Then reattach the lens by inserting it and rotating counter-clockwise until it locks. You may repeat this a few times.
Turn the camera on and check if the problem persists.
If so, you can try cleaning the contacts that connect the lens to the camera body: detach the lens completely, and look at the rear flange of the lens to locate the contacts. Wipe the contacts carefully with a pencil eraser. Be careful to avoid debris getting into the rear of the lens. Then look at the lens flange on the camera body to locate the lens contacts' counterparts, and wipe these with the pencil eraser as well. Again, be careful not to get any debris inside the camera. Reattach the lens, turn the camera on and check if the problem persists.
If the above did not solve the problem, you'd have to figure out if the problem is with the camera or the lens. The easiest way to do this is to try a different lens. If you don't have one, see if you can borrow one from a fellow Nikon owner. The lens does not have to be identical to the lens that came with your camera, any recent Nikon AF-S type lens will do. If autofocus works with the other lens, the the problem is almost certainly with your lens.
In case the lens is a cheap kit lens like the AF-S DX 18-55, it is likely not worth the trouble to repair, since such a lens can be bought new for about 100 bucks - or you might take the opportunity to upgrade to a better quality lens.
If autofocus does not work even with a different lens, there's no easy fix - the problem is almost certainly with the camera body. There are (as far as I know) no menu settings that inhibit autofocus from working correctly. However, consider the following: If you're using LiveView (that is, you use the camera's LCD display rather than the optical viewfinder for composing your shots) autofocus will always be slower and less precise compared to using the viewfinder, and depending on conditions the camera might not be able to focus correctly.
Был ли этот ответ полезен?