Question Walk to and animate pattern

eli07

New member
Messages
7
Reactions
1
Points
3
Hi,
I would like to build a scene where there would be multiple persons walking to certain points, then playing some animations (sitting down, laying down, doing other stuff), then standing up again, walking somewhere else etc etc.

In more technical terms, this could be described as a dynamic state machine, where the states can be switched between Person atoms and triggered while the persons are at arbitrary coordinates in the scene.

How would i best go with this? I have no problem with programming, so i can build the state machine logic as a c# script, however i have encountered some issues with animations. I have downloaded various scenes where person atoms are walking and seen how it's done there, but for this use case there are short commings.

Most of the scenes use the Timeline plugin. The movement across the scene is however made by moving the individual controllers (hear, arms, legs, ...) in the absolute global scene space (not relative to the root controller). The root controller stays at the spawn point the entire time. Here i see following shortcomings:
- Can't tell where the person actually is. Or, i could by getting the position of individual controllers (like headControl), but what's more important:
- This isn't at all reusable. The animations are super tied to that particular atom and point in time. I can't reuse them anywhere else, or at any other time (when the person's absolute position in the scene is different)
- When the person's position is different than its root controller's position, i can't use any poses (if i want to create custom animations between poses i downloaded from the hub) because applying the pose centers the person back to its root controller, which looks like teleporting.

I tried using CLS https://hub.virtamate.com/resources/cls-2-demo-character-controller.20823/ and for walking it looks good, but it manipulates the root controller in a way in which i can't apply further poses to it (sticks the Y coordinate of the root to the ground; but yay, at least it moves the root together with the person) and also i can't use timeline animations for other poses because i would want to trigger them from any point in the scene (and possibly rotation of the person).

Or am i missing something and what i described can be actually easily done?
 
Coincidentally, I was just now looking for walking animations to use in my scene. I also couldn't find one that served my purpose. What I'm going to do now is go to the site mixamo.com and grab some walking animation there. You can mark the "in place" option for the animation to stay in place. To convert the animation to use in vam, follow this tutorial:
I haven't tested it yet but it should work.

Good luck with your scene, from your initial description it seems like it's going to be interesting.
 
Last edited:
Upvote 0
@VamWizard
... however i just found out that the BVH player has no "Receiver target" to select/play/stop the animation, so can I control it from "outside"? Meaning a button press, or C# script.
 
Upvote 0
I tried using CLS https://hub.virtamate.com/resources/cls-2-demo-character-controller.20823/ and for walking it looks good, but it manipulates the root controller in a way in which i can't apply further poses to it (sticks the Y coordinate of the root to the ground; but yay, at least it moves the root together with the person) and also i can't use timeline animations for other poses because i would want to trigger them from any point in the scene (and possibly rotation of the person).
Or am i missing something and what i described can be actually easily done?

You could use Timeline looping animations with CLS, play walking cycle while moving, some other looping animation when stopped
I would also highly recommend LogicBricks, its awesome!
You could use SelectChoice to trigger different animations depending on what you need. There is also a StateMachine plugin there
 
Upvote 0
You could use Timeline looping animations with CLS, play walking cycle while moving, some other looping animation when stopped

Is there maybe some tutorial how to do it?
With CLS i came across two obstacles, each happening under different circumstances and both having something to do with animating the person beyond what CLS does. For example when i wanted the person to sit down when arriving to specified location (play stand -> sit animation, maybe alternate between different sitting poses).
First obstacle, when keeping the root control intact (not checking the option in CLS) - person is off center compared to its root control, no animation can be reused since those are not relative to the person's root control
Second obstacle, when checking the root control option in CLS - the plugin always resets the root control's Y coordinate to the ground, meaning you can't play the "sit down" animation.

Essentially what i need is a way to animate the person controls relative to its root control (and then animate the root control itself), not relative to the world itself (which means the control coordinates are always absolute)

Thanks i will check out the LogicBricks plugin (y)
 
Upvote 0
@VamWizard
... however i just found out that the BVH player has no "Receiver target" to select/play/stop the animation, so can I control it from "outside"? Meaning a button press, or C# script.

If you use the old BVH Player, there is a bake option. This option will bake the animation into the scene. After that, you can import that animation into the timeline (from the scene). When the animation is in the timeline, you can trigger it through C# scripts.
 
Upvote 0
@VamWizard so maybe i'm missing something, but how do i do that? I can press the "Bake" button in the BVHPlayer plugin, after a few loops i press Stop - how can i now access the "baked" animation?

Is this animation independent from absolute coordinates? Can i reuse it on multiple person atoms placed differently in the scene?
 
Upvote 0
@VamWizard so maybe i'm missing something, but how do i do that? I can press the "Bake" button in the BVHPlayer plugin, after a few loops i press Stop - how can i now access the "baked" animation?

You can view the animation by clicking the Play button in the user interface. You can also access though the "Scene Animation" tab. Note that you won't see the animation playing if the BVH Player is enabled, so disable it first, after baking. The purpose of passing the animation to the scene is only to be able to later transfer it to the timeline, as it is not possible to directly transfer from the BVH player to the timeline. ( BTW, you only need to bake one loop, the repetition of the loop will be handled in the timeline. )

Is this animation independent from absolute coordinates? Can i reuse it on multiple person atoms placed differently in the scene?

If you checked 'stay in place' when you imported from Mixamo, yes.
 
Last edited:
Upvote 0
Also you can use Timeline for walk animation and "Animation Pattern" atom for moving person node root. Just make animation steps and you character will move where you want.
In AP options choose "Receiver Atom"-> Person, "Receiver"-> control. Create animation steps and done.
But before it, you'll need align AP with Person root.
 
Upvote 0
Back
Top Bottom