Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - bluelotus

Pages: 1 [2]
16
Support / Text in a sprite collection not aligning correctly?
« on: October 22, 2012, 11:24:13 am »
Hi guys,

Trying to get an xml based font exported from glyph designer into 2dtoolkit and running as a sprite collection.. .
It is visible but I had to scale it up by a factor of 100 - the dimensions of the text mesh objects match what the letters should look like but the texture is not aligned and it looks like abstract art.

Any ideas where I am going wrong with this?

Thanks,

Blue L.

17
Support / Re: Animation stuck on first frame - how to stop this??
« on: October 07, 2012, 03:47:44 am »
Right so the debug info looked correct -
I changed to clipId to remove possible naming issues.

   if ( Xdest > transform.position.x )
      {
         if (anim.Playing == true && anim.clipId != 1)  {
             anim.Play("walkRight");
         }

                transform.Translate(new Vector3(1,0,0));
                }


It still didn't work.
Back to Unity and it turns out my frames in the Tk 2d animation script were all set to a length of 1 frame. 
Not sure how this was reset prob due to Unity crashing with me not saving often enough.

Anyway it works with the frames set to a longer length like 3.
Bit of a noob mistake.  8)

ALL GOOD!

BlueLotus.

18
Support / Animation stuck on first frame - how to stop this??
« on: October 06, 2012, 11:55:45 am »
Hi Guys,

Just got the 2dtoolkit and its good. :D

However, I am new to unity coding and am having trouble making the animation play correctly.

The following confuses me.
It says that the CurrentClip name is "walkRight" -
If this is true it should not re-trigger the animation -
But it seems to be re-triggering the animation every frame anyway?

I must be missing something, (perhaps to do with the delgate, which I have bypassed)
Any advice would be appreciated -

Here is the snippet,

Debug.Log( "current anim " + anim.CurrentClip.name);
      if (anim.CurrentClip.name != "walkRight")  {
    anim.Play("walkRight");}


And here is the full code -

   void Update ()
   {
      
         Debug.Log( "PLaying" + anim.Playing);
      
      
      if ( Xdest > transform.position.x )
      {
         
            Debug.Log( "current anim " + anim.CurrentClip.name);
         if (anim.CurrentClip.name != "walkRight")  {
    anim.Play("walkRight");}
         
         //anim.Play("walkRight");
         //anim.animationCompleteDelegate = null;
         transform.Translate(new Vector3(1,0,0));
         walkingRight = true;
      
         
      }
      
      else if ( Xdest < transform.position.x)
      {   
         if (anim.CurrentClip.name != "walkLeft")  {
    anim.Play("walkLeft");}
         
         
         //anim.Play("walkLeft");
         //anim.animationCompleteDelegate = null;
         transform.Translate(new Vector3(-1,0,0));
         walkingLeft = true;
         Debug.Log( "current anim " + anim.CurrentClip.name);
      }
      
      else
      {
         anim.Play("idle");
         anim.animationCompleteDelegate = null;
      }
   }
}
   
Thanks,

BLueLotus.

Pages: 1 [2]