- Home /
'speed' is not a member of 'Object'. when pausing animation
I got this code:
var animationDisable : GameObject[];
private var memObject : GameObject;
private var animState : AnimationState;
for(memObject in animationDisable){
for(animState in memObject.animation){
animState.speed = 0;
}
}
and i get the error 'speed' is not a member of 'Object'. on compilation I don't really get what the deal is. I'm doing it exactly the way the script reference shows it.
This issue is a bit strange to me, but I don't know Javascript as well as I would like. There is probably a Javascript reason for this behavior. But you can "solve" the issue by:
for(var animState : AnimationState in memObject.animation)
yes i know that solves the problem. The editor would then spit out an error saying that animState has been downcasted from 'Object'... but i would really like to know why my way wouldn't work in the first place...
Interestingly... or not... even if i make the animState var of type Animation i still get same error...
Your answer
Follow this Question
Related Questions
Animation Sometimes Shows Error dt >= 0 0 Answers
Creating a play/pause button for animations. 0 Answers
Animation error at state speed change 1 Answer