When playing in editor, if I click on my player character in the world outliner, the following appears:
1 Like
If anyone else runs into this problem: when I pressed F8 and clicked the character in the editor, it triggered this error. The debugger pointed to the movement component and it was really hard to find the culprit. The cause turned out to be another component whose BeginPlay
contained this code:
CharacterMovementNPC = OwnerCharacterNPC->FindComponentByClass<UCharacterMovementComponent>();
The issue wasn’t how I retrieved the movement component, but that I did it in BeginPlay
. I suspect CharacterMovement
hadn’t finished initializing yet — which caused the error. As soon as I added a short delay, the problem went away.
To pinpoint the offending component I had to create another class derived from the base and literally strip it down piece by piece, removing and testing until the error disappeared.