+3
Under review

Condition if Character State == or !=

Maximilian PS 2 months ago in Game Creator updated 2 months ago 4

Hello there,

I need to check if my Character state is different from the default one. (I'm talking about the animation)
in particular, this things is needed 'cause when he draw/wield a weapon, he have to assume a position and when he sheath the weapon, he have to change state and also run some actions.

Also, because of many different States, i need to use != from default instead of == 
About that, from time to time I fill the need of != operator 😅

Anyway, I think that I could workaround it, but having that kind of Condition would be awesome ☝😁👍

Unity version:
Game Creator version:

Answer

Answer
Under review

The idea would be using a boolean or an integer Local Variable to know at which "state" your character is; having a sheathed weapon, holding a hammer, holding a sword, etc...

However, you mention you miss having more "different" comparators instead of equals. Every time this happens, would you mind dropping them in this topic? I can easily add them :-)

PS: How did you add emojis to your text? I thought it wasn't possible to UserEcho!

Answer
Under review

The idea would be using a boolean or an integer Local Variable to know at which "state" your character is; having a sheathed weapon, holding a hammer, holding a sword, etc...

However, you mention you miss having more "different" comparators instead of equals. Every time this happens, would you mind dropping them in this topic? I can easily add them :-)

PS: How did you add emojis to your text? I thought it wasn't possible to UserEcho!

+1

I've used Google Chrome emoji 😁
About state we could have a user inferface to choose "this character/invoker/player" is == or != to this state and we could directly drop the state that we want to check...

Maybe "we" could add a check box, for any state, or if the user leave the field empty would mean == or !=  null 💪😏🤘

I believe it's a bit more complicated than that. The way States work is by having a default animator running, which feeds into a new State layer 1, which feeds another State layer 2, which also feeds a third State layer, and finally outputs the final animation.

However, when you make a character play a State in Layer 1 (for example), it will create a Playable mix. However, when we exit the State and return to the default one, the Layer 1 State is not destroyed, but the weight of that animation is lowered to zero.

This means that asking if this State is playing would return true, even though it's not playing. Of course we could also check if the weight is higher than zero, but things start to get a bit complicated, so it's not that trivial.

I'll open a ticket, but this might take a bit longer than expected

+1

Ok I'll start thinking on a workaround 🤞😅