How to use animation sharing plugin?
I try use documentation, but can't get needed result. Does more detailed guide exist? In particulare, i can't undestand where to use Anim Sharing State Instance and where can i create rules for plaing animation (for example, transition between walk and run).
While the documentation is confusing and seems to be lacking, the information is there. Jieyuan shi regarding what you posted on my other question, you are getting the wrong idea of the plugin. This isn't meant to share an existing animation blueprint across other actors. This is meant to be a self-contained way of having a pool of animations that can be shared to a huge amount of actors. This is really only useful in my opinion if you have a large amount of actors (probably at least 50+ to make this useful) on screen that all share the same basic animations.
First we need the basic "containers" for our animations. This is the Anim Sharing State Instance part of the documentation, you can really copy paste that piece of code and there's no need to fill the "animation to play." Then we need a transition blueprint to handle the transition between animations and that is right below the Animation Blueprint Setup part of the documentation. Again, you can follow the directions exactly.
Now we need the logic driving how characters move between animations. We can find that in the Animation Sharing State Processor part of the doc. For the processor, we need to create a simple enum that we will use to point towards our animation blueprints we created earlier. (If we had walk, run, idle - in the enum we want a walk, run, idle). In the class defaults, select that enum you created. Now, we want to override ProcessActorState in the functions. In our actor that will use this system, create a variable of that same enum. You can see the documentation casts to the actor and grabs the variable. This is how our characters move between animations- just change the enum value on its variable.
Last, the Animation Sharing Manager is pretty straight forward. Hook up all the things we just created. Animation States is where you hook up the anim bps. Anim sequence is the animation you want to be played in that BP.
Also don't forget on the character to run the register code.
answered Jul 13 '19 at 03:12 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here