I set up my mecanim with a blendshape character. I drag and drop the character into the Slate Editor and create a new mecanim track. I then added a SetBool operating for the parameter “Walk”.It is not working, I can see that the parameter is not toggled in the editor’s “Animator”. Both in play mode and while scrubbing the Slate Editor.
I know that the character is set up correctly with the Animator script all working because I’ve tested it with a simple script:
1
2
3
4
5
voidAwake()
{
animator=GetComponent<Animator>();
animator.SetBool("Walk",true);
}
I looked at “SetBoolParameters.cs”
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
protectedoverridevoidOnEnter(){
lastValue=actor.GetBool(parameterName);
}
protectedoverridevoidOnExit(){
if(length>0){
actor.SetBool(parameterName,lastValue);
}
}
protectedoverridevoidOnReverse(){
if(Application.isPlaying){
actor.SetBool(parameterName,lastValue);
}
When I added this to OnEnter():
1
2
3
4
5
6
protectedoverridevoidOnEnter(){
lastValue=actor.GetBool(parameterName);
actor.SetBool(parameterName,value);
}
It works for Play Mode but still not when I scrub the Slate editor. Can you tell me what I messed up? I’m using 1.2.5 and Unity 5.3.2f1. Thanks.
Indeed there is an error in the original code. Your change is correct adding this line there. Thanks for that.
With that said, I’ve just tested this with the UnityChan model on the asset store as an example and the SetBool now works correctly when scrubbing the time in editor. I’ve tested with Slate 1.2.5 and Unity 5.3.4f1.
Are you on 5.3.2f1 as stated or did you also mean 5.3.4f1?
Please let me know.
Thanks.
Join us on Discord: https://discord.gg/97q2Rjh
Author
Posts
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.