CRASH! When StartLocation is added in C++

I have found that Unreal does not like it when you “GetPawn()” for the Start Location in C++. It wants you to check for null pointer and only then will it work. Don’t know why, but thought this might help someone.

Solution
if (GetPawn()) { Put Start location code in here }

1 Like

That’s actually a good check. I would recommend assigning the result of GetPawn() to a variable first and then checking for nullptr. It’s better to not call it twice if you need to access it twice.

Thanks for sharing.

Privacy & Terms