x


2.5 platformer sprite animated character

Hi, I'm trying to do a game with 2d graphics like Paper Moon. The character should be sprite animated, moving in a 3dmensional environment, giving a sort of paper mario feeling. I googled a lot about using planes, animating spritesheets, using the offset,even managed to use the code in the wiki, but what I can't understand is how to associate the animation to the controls.

How do I trigger the tiled animations (walk animation when walking, run animation when running, etc.)? Because my character can walk and jump, but it's not properly animated. I'm using the scripts contained in the 2d platformer tutorial.

Thanks in advance.

more ▼

asked Jul 13 '10 at 03:06 PM

Ugo gravatar image

Ugo
11 1 1 2

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

check out this new tool set called ex2D: http://www.ex-dev.com/ex2d/index.html

it's very easy to use and use the same workflow to create 2D content as other Unity built in tools.

more ▼

answered Aug 12 '11 at 02:50 PM

nantas gravatar image

nantas
16 3

(comments are locked)
10|3000 characters needed characters left

I'm assuming that you would just be changing which material/animation/sprite/whatever you're using in the same place the 2D platform tutorial crossfades/plays different animations.

more ▼

answered Jul 13 '10 at 03:27 PM

Tetrad gravatar image

Tetrad
7.2k 27 37 89

I don't understand, is it something I need to put in the animation script? Lerpz, the default player, is given with a set of imported-animations of 3d models. The animation script seems to call the animations whenever is needed to. I've tried to make an animation using Unity built-in animator in which I change the offset of my spritesheet from frame 0 to 4. This way I could make an animation instance which could be triggered by the given script, but the Unity animator seems to try to blend the frames together, not displaying them instantly like the code I took on the wiki.

Jul 13 '10 at 05:03 PM Ugo
(comments are locked)
10|3000 characters needed characters left

Try page 12 of the Evac City tutorial.

Using the built-in animator is probably not the way to go, since you need to "snap" the material to a particular offset. Doing this in code is much easier.

You could do this in a separate animation script, or you could simply modify the PlatformerController. Look for the part of the script where movement is happening, and just add your own code to check isGrounded, isMoving, etc. and change the texture offset accordingly.

To get the proper framerate for your animations, you can store Time.time whenever you change the offset and then make sure a certain amount of time has elapsed before changing it again.

more ▼

answered Jul 27 '10 at 05:45 PM

Ehren gravatar image

Ehren
4.2k 34 43 77

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5081
x3791
x215
x186

asked: Jul 13 '10 at 03:06 PM

Seen: 3562 times

Last Updated: Aug 12 '11 at 02:50 PM