Hello, I’ve recently jumped from UDK and Unrealscript to UE4 and C++ so I feel that this is quite an obvious issue and it’s just my unfamiliarity with C++ that’s the problem, but I’ve been stuck on this for several hours now.
I’m defining a custom enum inside my PlayerController header like so:
Then I have it setting CState to CS_Idle during the Player Controller’s initialization by setting it like so:
CState = CS_Idle;
All of this is fine and no issues arise from this, but when I try and modify the variable to indicate that the player is moving like in the image below, it crashes the game and editor:
I don’t fully understand Enumeration in C++ (Or C++ in general, I’m quite new to it though I have experience in Uscript and C#) so any help resolving this would be fantastic, thank you in advance.
I changed mine to reflect yours, everything else the same apart from the new way of tackling the enums, it built fine… But it still crashed upon attempting to move, which is quite confusing
Oh this is interesting, it turns out the issue is more to do with how I am determining if a player should be in their ‘Idle’ state that is causing the crash
(Which isn’t being calculated if they’re already in the Idle state, which made it seem like changing to ‘CS_Moving’ was causing the crash, when really it wasn’t at all!
Thank you for your help, AnXgotta, I now have a new problem to tackle haha.