Hi guys
I’m going to try and explain this as clearly as I think I can…
I’m busy messing around with animation state machine and c++
My state machine currently has these states:
on the condition node between idle run to Press Button, I have the condition like so:
within my CharacterAnimInstance.h class, I have:
UCLASS()
class THEFORGOTTEN_API UCharacterAnimInstance : public UAnimInstance
{
GENERATED_BODY()
public:
UCharacterAnimInstance();
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool IsPressingButton;
};
On my Character class, where I handle all the inputs, I have a function to handle when the user presses “E” (for example).
void AMyCharacter::PressButton()
{
//Should I update UCharacterAnimInstance.IsPressingButton from here?
}
Now: my question is this. Is it good practice to update the IsPressingButton from the player Character class, or am I over thinking this?
If its the right place to do it, then HOW do I do it. Cause every time I try something, the engine crashes.
please let me know if the question is unclear or if you need more info
Thanks in advance