2D Toolkit Forum

2D Toolkit => Support => Topic started by: phatality123 on September 17, 2012, 01:27:16 am

Title: Error on run
Post by: phatality123 on September 17, 2012, 01:27:16 am
When I run my game, I get this error:

Instance of tk2dAnimatedSpriteEditor couldn't be created. The script class needs to derive from ScriptableObject and be placed in the Assets/Editor folder.

Anyone know how to fix it? Heres my script, too:
#pragma strict
var Ryuuji : tk2dAnimatedSprite;
function Start () {

}

function Update () {
   if(Input.GetButton("Vertical")){
   Ryuuji.Play("WalkForward");
   }
}


Also, when I hit the up arrow key, It shows the first frame of his "WalkForward" animation but it doesn't play the full animation unless I let go of the arrow key. Any way I can make it so the opposite thing happens? (As in when I hit the up arrow key his animation plays and when I let go of it his animation stops). Many thanks.

Ok, I got that part fixed, but now I'm getting this error when I add the StopAndResetFrame component:

Assets/TK2DROOT/tk2d_demo/TestAnimationPlay.js(12,16): BCE0019: 'StopAndResetFrame' is not a member of 'tk2dAnimatedSprite'.
Title: Re: Error on run
Post by: unikronsoftware on September 17, 2012, 08:14:31 am
I'm not sure what you've done and what you haven't, but most importantly have you run the "2D Toolkit/Setup for JS" menu item?
Title: Re: Error on run
Post by: phatality123 on September 18, 2012, 12:07:20 am
Even when I click that button (Setup for JS), it just keeps showing that error :l.....
Title: Re: Error on run
Post by: unikronsoftware on September 18, 2012, 08:58:45 am
Easiest thing to do is if you can, zip up the project, and email to support@unikronsoftware.com. Let me know if you cant do that and I'll see if I can think of more suggestions.
Title: Re: Error on run
Post by: phatality123 on September 19, 2012, 03:12:31 am
Ok I'll send the project.