I had the same problem in c++ only to find out that i have being the game in Client mode. When playing in client mode this will return null. In standalone this will work. To make sure it works in Client you have to go to project settings ->Navigation and Allow Client Side Navigation