I’m running into some difficulty changing boolean properties with SetCurve.
I have it working on my own custom scripts fine but it appears to be problematic on the Unity Components themselves.
AnimationCurve c = new AnimationCurve()
Keyframe1 = new Keyframe(0.0F,0.0F);
Keyframe keyframe2 = new Keyframe(10.0F,0.0F);
c.AddKey(keyframe1);
c.AddKey(keyframe2);
animClip.SetCurve(“”,typeof(BoxCollider),“isTrigger”, c );
Nothing changes.
If i use my own component with the above code and my own bool var, the bool changes fine.
if i add BoxCollider isTrigger to an animation window via the animation window menu and change the flag it works fine.
If open up the animation window once i have run the code above, i see my variable but the text is flagged as red and there is no checkbox next to the variable name. This is the one difference i can see versus adding the curve directly in the animation window.
Rotations,Positions and everything else work fine.
Is there something else i have missed? I thought maybe the tangent mode not being stepped would be an issue but even changing that in the animation window on my curve has no effect.
This pretty much applies to any bool in any of the normal components, enabled, isTrigger etc in Animation,Transform, MeshRenderer etc
I tried changing the animation type in debug from legacy to generic etc to no avail.
I’m on Unity 4.3.4f1
Any ideas?
cheers