I am trying to figure out how to determine whether my main character follows an Unarmed locomotion state machine or a Armed locomotion State machine. The trigger for which path the character uses for locomotion is determined by whether or not the character has an equipped weapon or not. Thank you.
Hey @Pathprof70! Welcome to the forums!
I am not aware of a way to actively check if an actor has something attached to a socket, however when attaching something there are multiple ways to go about it!
You could:
-
Give the player a boolean (like: “HasWeapon?”) And when the weapon is attached to the character, flip that bool to true and when it is disarmed flip it to false.
-
Use an Enumerator to describe what kind of weapon, if any, the character has. This would need to change every time the character switches weapons or gains/loses their weapon.
I’d say those are the simplest methods.
Then, on your animation blueprint, you just use “Try Get Owner” and cast to the blueprint and get that variable to set your variable on the ABP.
Let us know if we can help more!