Hi. I had a problem.
When I run my game, my game dead soon. I don’t know why my game dead shortly even I tried null point check when code excuted. For example. I don’t use uproperty at below code at _StateController.
UCLASS()
class SAVINGGAME_API ABaseCharacter : public ACharacter, public IDamageInterface
{
GENERATED_BODY()
UBaseChracterStateController* _StateController;
}
But when I declare UPROPERTY on the _StateController that uobject derived class and include TMap. My game become stable.
I don’t know why it is fixed. Please. Let me know when I must use uproperty and how it work in code? here is my code.
ABaseCharacter.h
UCLASS()
class SAVINGGAME_API ABaseCharacter : public ACharacter, public IDamageInterface
{
GENERATED_BODY()
UPROPERTY()
UBaseChracterStateController* _StateController;
}
UBaseCharacterStateController.h
UCLASS()
class SAVINGGAME_API UBaseChracterStateController : public UObject
{
GENERATED_BODY()
protected:
UPROPERTY()
TMap<ECharacterState, UBaseCharacterState*> stateMap;
}