Jump to content

AnimationSequence error


Rick
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...