Open lznt opened 11 years ago
You probably have to change the signal connection line to frame.DelayedExecute(1.0).Triggered.connect(this, this.EnableAnims);
Otherwise this
wont probably mean what you think it will when you enter the callback. I see you already do this in the frame.Update connection. Anyhow this.me.animationscontroller should not crash even if its not there, but always good to put some if (this.me.animationcontroller != null) checks in place. If that says null the component is not there even if you say it is. The this or this.me is something else that you think it is :) Printing these things helps a lot for simple debugging. print(this.me)
for example at the start of CheckAnims will print the entity name to the console, so you can be sure.
It seems that this snippet crashes tundra everytime we enter CheckAnims. The entity this.me has animationcontroller component and its found if we print it for example. The crash message is animationcontroller is not an object and is "undefined". Same thing happens if I add dynamiccomponent checks inside EnableAnims, but then it ofc crashes to dynamiccomponent being undefined. Entity has that one also.