Hey Tony, I'm trying to do something with animator layers/weight and I'm wondering if there's a way to do it with DS.
I have two spine animations of a background, a base layer and a "distance" layer where it look farther away (scaled down).
I also have a main conversation that runs every "turn" so to speak. Each time it runs, I'd like it to increase the weight of the distance layer by a small amount, maybe 0.1. The idea is to make the background appear further and further away with each turn.
Is there a way to use AnimatorLayer() but to add an increment rather than set an absolute value?
Using Animator Layers with Dialogue system
-
- Posts: 195
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Using Animator Layers with Dialogue system
Hi,
You can keep the weight value in a DS variable, and increment it in the Script field. Then use [var=variable] to include the variables value in your AnimatorLayer() sequencer command. Example:
You can keep the weight value in a DS variable, and increment it in the Script field. Then use [var=variable] to include the variables value in your AnimatorLayer() sequencer command. Example:
- Script: Variable["weight"] = Variable["weight"] + 0.1;
- Sequence: AnimatorLayer(1, [var=weight])
-
- Posts: 195
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Using Animator Layers with Dialogue system
Thanks, that works great. Don't know why I didn't think of it.
The only thing is, it doesn't seem to be animating smoothly even though I added a transition time. Just to check, this syntax is correct if I want it to take 0.5 seconds to change the weight?
AnimatorLayer(1, [var=BackgroundAnimWeight], Background, 0.5);
The only thing is, it doesn't seem to be animating smoothly even though I added a transition time. Just to check, this syntax is correct if I want it to take 0.5 seconds to change the weight?
AnimatorLayer(1, [var=BackgroundAnimWeight], Background, 0.5);
Re: Using Animator Layers with Dialogue system
Hi,
That's the correct syntax. Temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. This will log the sequencer command parameters as the Dialogue System's parser understands them. Maybe there's a typo or a parsing error and it's not detecting that the duration is 0.5 seconds.
That's the correct syntax. Temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. This will log the sequencer command parameters as the Dialogue System's parser understands them. Maybe there's a typo or a parsing error and it's not detecting that the duration is 0.5 seconds.
-
- Posts: 195
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Using Animator Layers with Dialogue system
I get this in the console. Seems correct I think?
Re: Using Animator Layers with Dialogue system
That looks correct. Is it possible that a weight of 0.04 is low enough that it doesn't have a noticeable effect on layer 1?
Can you send a reproduction project to tony (at) pixelcrushers.com?
Can you send a reproduction project to tony (at) pixelcrushers.com?
-
- Posts: 195
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Using Animator Layers with Dialogue system
It has magically started working
Thanks for your help!
Thanks for your help!
Re: Using Animator Layers with Dialogue system
Great! Make a backup / commit to version control. That way if it happens again you can compare it against your backup.