0
Answered

What is the "Layer 1, 2, 3" of "Changing state" Action?

JOON 5 months ago in Behavior updated by Marti (Lead Developer) 5 months ago 3

game-creator/characters/states

I am reading documents with joyful, but sometimes, the descriptions are not enough to guide noobie like me. while I am following the Example of Behaviour-the first one which makes Bot hands up when he can see me- I try to understand "Layer 1,2,3" but I can't understand yet even I read offical documentations... I guessed it is not same with Unity Layer... 

maybe... is it new concept of layers for playing animations???
if it is for playing animation? which number is top layer? first one or last one???

Unity version:
Game Creator version:
+1
Answered

Like in Photoshop, layers hide what's underneath. If you play a State1 in Layer 1 and then play State2 in Layer 2, the second one will mask the first animation.

It's a simple way to allow a character to, for example, hold a torch, while also being able to play a drunk state.

"Layer" confused me as well with Behavior. I found two things using "layer", in its name:


1) In Behavior is there is a Sight Layer Mask. I think this is the same as Unity's GameObject layers, with a drop down in every GameObject, generally set to default.


2) In Behavior Example 1, there is an action "Change Invoke state in Layer 1", with a dropdown labelled Layer with the options "Layer 1", "Layer 2" and "Layer 3". I'm guessing this is Unity's animator layers, which in GC's "Locomotion" animation controller would correspond to "Base Layer", "Land" and "IK". 

This could be completely wrong, but Marti will bring clarity to all things :)

Yeah this is a bit confusing and may need to change this in the future. Layers in Unity, as GameUX mentions, are used to discern collisions between Physics checks and sweeps.

On the animation side though, we use the concept animation to prioritize which animation takes precedence. Doesn't have anything to do with Animator's layer neither though. We built an animation system on top of it which lets us be more flexible.

Sorry for the confusion! I'll try to think of a better name for the next major iteration.