Rick Posted May 9, 2013 Share Posted May 9, 2013 I created a prefab of a player, where I attached the AnimationSequence script to it. Then in App.lua file I load the prefab in App:Start(). In App:Loop() I call it like: self.player.animationmanager:SetAnimationSequence(1, 30, 200) Where self.player is the prefab I loaded. I get an error when this function is called saying self.animations doesn't exist. The Script:Start() does get called, which creates the self.animations table, so not sure why the table isn't there when SetAnimationSequence() gets called, but seems it's somehow not. Seems like the scripts variables don't hold after Script:Start() for some reason. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted May 14, 2013 Share Posted May 14, 2013 Can you post an example of this Rick? I will have a look at it. Quote Link to comment Share on other sites More sharing options...
Rick Posted May 20, 2013 Author Share Posted May 20, 2013 What sucks is that I always have models that I've purchased in the game so I can't just give the project out, and those are the only models I have that have animations. I would just say the steps to reproduce would be. 1) Add a model that has animations and has the animations broken out 2) Add the model to a scene 3) Attach the animationmanager script to that model 4) Save as prefab 5) In lua code load the prefab (Prefab:Load()) 6) Access the animationmanager via prefab.animationManager:SetAnimationSequence(1, 30) and you'll see it blow up Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted May 20, 2013 Share Posted May 20, 2013 I will try it out. Is it just a Lua only? or an entity script while using X++? Quote Link to comment Share on other sites More sharing options...
Rick Posted May 20, 2013 Author Share Posted May 20, 2013 I've only tried in Lua. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted May 20, 2013 Share Posted May 20, 2013 After some testing together with Rick, I to have the same problem. if you add self.animations = {} to the SetSequence Function in the animation manager, it just skips on to the next variable that it can not find. Quote Link to comment Share on other sites More sharing options...
Jim Posted May 24, 2013 Share Posted May 24, 2013 Did you find answer to this Quote Link to comment Share on other sites More sharing options...
Rick Posted May 24, 2013 Author Share Posted May 24, 2013 Not sure if Josh fixed this in the most recent update or not. Will have to test again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.