Forum rules - please read before posting.

Animation not playing during [Variable][Check random]

edited August 2023 in Technical Q&A

Hello all. First of all, I'd like to apologize for the frequent posting. We're working hard towards having a demo ready mid- to late-September, and there are more problems than we didn't anticipate. As always, I really appreciate the help, so thank you.

The issue:
I've set up a "Player Run listener" (attached it to the character) using a script Chris gave me and assigned an action list. In this action list, I have a SanityCheck, which, when triggered by a value, activates a Variable: Check random number. The problem is with playing animations directly. It plays animations if I add text or an engine wait before the animation. If I set "wait to finish," it even softlocks the game. Also, it doesn't always reliably play the animations depending on direction. What the Variable check random is supposed to do is roll the dice on whether the character trips or not if the sanity variable is below a specific value.

Here's my action list: https://drive.google.com/file/d/1Tk8xArbn49Ai0_WRkIC9UrWAU5jGCK3-/view?usp=sharing

Here's a video of the issue:

https://drive.google.com/file/d/19xNl93aiJscjP_A7Kgdbfd-78FEyhQJU/view?usp=sharing

In the video, you'll notice the softlock occurred the first time when I removed the "wait time."
The animation played when I added text, but the moment I set the text to "run in background," the variable random checker just ignored it. The idea is to have these animations stop the player from running and play the animations instantly, but I can't seem to be able to do that. I've also tried setting a run in parallel, where it waits or plays text and runs the animation, but that doesn't work either.

This is the script used (provided by Chris):

https://adventurecreator.org/forum/discussion/14041/mechanic-trigger-a-variable-when-running-double-clicking-possible#latest

As always, thank you in advance.

Comments

  • What messages are appearing in the Console? It should report any missing animations that it's trying to play.

    I don't see any "soft locking" occuring in the video, but I'd expect it's down to the expected animation not playing due to being overridden by the movement animation.

    Try first running a Character: Move along path Action, with the Stop Moving method first, to stop the Player before playing any animation.

    If a "wait time" is necessary, try setting a wait time of -1, which will cause it to run exactly one frame.

    As your Player uses the "Sprites Unity" animation engine, animations are played automatically. You may need to switch over to "Sprites Unity Complex", which offers a lot more control when it comes to overriding animations from the default. See if either of the above help first, however.

  • Adding a wait time of -1 doesn't play the animation - it just ignores it. And Character: Move along path/Stop Moving - softlocks the game as before. There's no message in the console regarding the animation. I think I may need to switch to Unity Complex.

    Here's a video https://drive.google.com/file/d/1jYOfsUoMOKhAOVw3E_qK-26Jw_jDrJC0/view?usp=sharing

  • Try both the Stop Moving and -1 wait commands together - and check "Is instant" in the former as well.

  • that did the trick! Thank you again, I would have never figured the combination out without your help! I've added a screenshot of the action list in case anybody wants to recreate this logic.

    https://drive.google.com/file/d/1207agbC6fmUYqGXdhQz0zvp0ynumMq0f/view?usp=sharing

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.