Page 1 of 1

I have a question about ConditionObserver.

Posted: Tue Oct 12, 2021 2:26 am
by Ryoh
Hi, I have a question about ConditionObserver.

I attached ConditionObserver to object.
I set a variable as a condition, like Variable["something"] == true.
Then I set a sequence like AnimatorBool(AnimParameterName, true).
The object ConditionObserver attached has Animator, so I think AnimParameterName becomes true
when variable "something" is true, but it doesn't.

Do I miss something?
Maybe the object should be speaker or listener? Then how should I set the object as speaker or listener?

Thanks.

Re: I have a question about ConditionObserver.

Posted: Tue Oct 12, 2021 8:36 am
by Tony Li
Hi,

ConditionObserver doesn't provide a way to specify a default subject, so you'll need to provide the subject to AnimatorBool(). Example:

AnimatorBool(AnimatorParameterName, true, SomeGameObjectName)

Re: I have a question about ConditionObserver.

Posted: Tue Oct 12, 2021 8:31 pm
by Ryoh
It worked!
Thanks Tony!

Re: I have a question about ConditionObserver.

Posted: Tue Oct 12, 2021 8:55 pm
by Tony Li
Glad to help! :-)