Don’t do calls in constructor because it’s used exclusively variable defaults and there initiation, it’s called (may even few times) in very premature state, in that point viewport does not exist, so you calling to null pointer and cause the crash. Call it on BeginPlay() instead.