0
votes

I'm learning unityscript for Unity 3D. I'm new to programming (one month old) and I'm building a 2D game that is going pretty good so far.

Cubical Chimera

My code (game not updated in the above example) allows the character to cycle through from shooting position (shown in game) and standing, when the Left-CTRL button is pressed ("Shoot").

I need a Much better method.

How do I program sprite sheets Correctly using unityscript in Unity 3D?

   var numFrames    : int = 2;
   function Update () 
   {
    if (Input.GetButtonDown ("Shoot"))
       {        
        renderer.material.mainTextureOffset.x += 1.0 / numFrames;
       }
    }

There's more, but this shows the crummy sprite animation I have conjured up. Please help...

1

1 Answers

1
votes

http://walkerboystudio.com/html/unity_course_lab_3.html

Go down to part 14 and on. That should be what you're looking for. It helped me a lot!

If that doesn't work, try this: http://wiki.unity3d.com/index.php?title=Animating_Tiled_texture