So, I’m pretty new to Unreal Engine. I very much enjoy its extension on C++, it’s very thoughtfully developed.
But I’m running into a weird problem when trying to access the character movement properties from my controller. I have the following code in my player controller constructor:
GetCharacter()->GetCharacterMovement()->MaxWalkSpeed = 200
For some odd reason this causes the editor to crash when running the game, and until I compile the code without it, the editor will crash during the splash screen.
I feel like I’m missing something here. Why would this cause a crash? There must be a reason. Is it because the player controller class initializes before the character class does? That’s the only reason I can think of.
Thanks for reading. Hope someone can help!
EDIT #1:
I noticed that if I place that line in another function such as a movement function it runs fine. This further makes me think the problem is the character class has not yet initialized when the player controller constructor is called.