Animation broken for Color3 (Cannot read properties of null (reading 'getRestPose'))

I designed this animation with the ACE editor, it worked fine. I tried exporting it to both a json and a snippet, and neither worked, so I just put the raw animation into the js.

If you wanna try it with the snippet, the code is “9ZLFYM”

All it does it change the diffuseColor of the cylinder.

There are multiple problems in this small part of script.
Before entering ACE values or anything, best would be to have a look at this simplified PG I quickly updated for you:

Problem #1:
Your animation uses Color3. Color3 expects you to enter the values like this:
value: new BABYLON.Color3(0.2099, 0.2739, 0.055)

Problem #2:
The ‘getRestPose’ error comes from the fact that you are animating a diffuse color that has not been defined. Your cylinder has no material and no diffuseColor. So the ‘restPose’ is undefined.

Problem #3:
You are using negativ values in your RGB values for ‘Color3’ but negativ values do not exist. The range is from 0/255 to 255/255.

Hope this helps,

Edit: Apologies. You may enter negativ values (as odd as it seems). Not sure it works though, but at least it doesn’t throw an error).

1 Like