Page 1 of 1

Animation Getting Stuck After Sequence

Posted: Sun Jul 22, 2018 1:33 pm
by pegassy
Hi,

I am using Opsive's TPC 1.3.9, and the regular shooter animator controller from the Clean Scene.

During a conversation I use AnimatorPlay(Pull, Player) to play a pull animation that is in the Right Hand layer of the animator. However, that layer seems to get stuck in the pull animation, and not go back to idle. I tried to run ; AnimatorPlay(Idle, Player)@2 after the first animation in the same sequence, but it still remains in idle.

Do you have any suggestions, or do you think I should check with Justin for a solution on TPC side?

Thank you so much.

Re: Animation Getting Stuck After Sequence

Posted: Sun Jul 22, 2018 1:57 pm
by Tony Li
Hi,

It sounds like your Sequence is similar to this:

Code: Select all

AnimatorPlay(Pull, Player);
AnimatorPlay(Idle, Player)@2
This will tell the Animator component on the GameObject named Player to play the "Pull" state at the 0-second mark. At the 2-second mark, it will tell the Animator to play the "Idle" state.

Does it ever play the Pull state? If so, then after the 2-second mark does it remain in Pull or does it switch back to Idle?

Is the player GameObject one of the conversation's primary participants (e.g., assigned as the Dialogue System Trigger's Actor, or is the GameObject that triggers the conversation)?

If so, does the player have a Dialogue System Third Person Controller Bridge component, and is its Deactivate During Conversations checkbox ticked? If it's not ticked, then TPC will retain control of the Animator. If you want TPC to retain control of the Animator, then you may need to use the TPCAbility() sequencer command to allow TPC to control the Animator as it performs an ability.

Re: Animation Getting Stuck After Sequence

Posted: Sun Jul 22, 2018 3:20 pm
by pegassy
It does play the Pull animation successfully, but it does not go back to the idle state by itself, so I added the second line with the idle animation. However, this did not change the status of the right hand layer, it does remain in the pull state. So when the character is jumping, or involved in any other action the hand remains that way.

TPC Bridge is on the character, but I had checked off Disable During Conversations for various reasons: one, because I would like character to be able to move during conversations, and two, because I am using DSU for various other hints and self-talks, etc, so I would like the character to be able to keep moving. I do not think I can specify the TPC bridge per each trigger.

Update: I just tried it with Deactivate During Conversations. The pull animation still played, and it still got stuck in that state.

Update: I just try to add a weapon on right hand, and confirmed that using the weapon fixed the issue. However, I could not find any TPC ability that affects the right hand layer, so I do not think any of the abilities would have the same effect.

Re: Animation Getting Stuck After Sequence

Posted: Sun Jul 22, 2018 4:18 pm
by Tony Li
Can you define a new TPC ability that puts the character's hand back in the idle state? Then use the TPCAbility() sequencer command to run that ability.

Re: Animation Getting Stuck After Sequence

Posted: Sun Jul 22, 2018 8:56 pm
by pegassy
That sounds like a good idea. I will give that a try.

Re: Animation Getting Stuck After Sequence

Posted: Sun Jul 22, 2018 9:40 pm
by Tony Li
If that doesn't work, let me know. In that case, I'll see if I can put together an example scene with a workable solution.