4.16 Crashes on GetWorld

Im getting the following crash when i run this code i had to write a new approach of accessing the new GetRandomReachablePointInRadius you guys deprecated in 4.16 and changed it to the bool version. I created a function to simply call the new version and provide the info it needs to run

Im getting them on just calling GetWorld info like 5 seconds after the world is loaded. Its called 5 seconds after the actor has been created fully .

	FNavLocation InResult;
	if (!NavSys)
	{
		//could not get UE4 Nav system
		return InResult;
	}
	//~~~~~

	bool bSuccess = NavSys->GetRandomReachablePointInRadius(IntialLocation, Radius, InResult);

	return InResult;

Also just tried this

It seems you’re trying to call functions on a nullptr

Once you fix that you should be fine :slight_smile:

Cheers,

–mieszko

this error any occurs in 4.16 if i run the same exact code in 4.15.3 it works perfectly without any crashes i dont know why the navigation system is returning null it doesn’t make any sense. Am i using the proper version for what you guys deprecated in 4.16?

You don’t understand. It’s not the navigation system that’s null, it’s your controller. It can be a result of a number of other changes in 4.16, unrelated to AI. Add null checks before calling your ReturnGetRandomReachablePointInRadius

ok i understand i’ll try that now if i might ask what was changed to make this occur? My curious side is well a bit curious!

it did in fact resolve the crash the AI now work as they did in 4.15.3, we have one last issue related to when we open our master levels in 4.16 they crash but do not crash in 4.15.3 should i mark this as the answer and start another thread here? What would you like me to do and thanks so much! =) Heres the fix i applied from your suggestion!

Yes, any other issues you find report in a separate thread.

Regarding your “fix” - it’s not a good one. You should not call functions on null pointers, which means you need to go up the callstack and identify code that results in this call.

Regardless, I’d say this issue is solved :slight_smile:

understood thank you :slight_smile: