animated sprite not showing up
by Juntaou · in iTorque 2D · 06/28/2011 (7:19 pm) · 9 replies
so hopefully this will be a quick answer from someone. Its been a bit since I last looked at it2d and I wanted to do a quick refresher so I started running threw the aquarium tutorial. Anywho long story short I took one of the fish sprite sheets. Turned it into a 4 cell image so it only shows the 1 fish then made an animation out of that. I moved both the static sprite and the animated sprite over. The static sprite will show up, but the animated wont. I have checked enable physics on both and have moved over all of the datablocks, so I don't know what else to do. I have had this problem in the past and I can't remember how I got past it(and a quick search didn't return anything useful to me.) anyone see what I'm doing wrong?
#2
06/29/2011 (6:49 am)
I'm not sure I follow what you are saying... I have a static sprite(one of the fish with 4 images of the fish on it. That I break down into 1 image of a fish(1 static sprite with 4 cells, only the one shows at a time). Then from that celled static sprite I make an animated sprite, so when I drag that animated sprite into the scene it shows up in the editor and its animated. I then drag that celled static sprite into the scene. So now in the editor I have 2 sprites showing the same fish. One is animated and one is static. I move both of the images over in the datablocks section, and make sure both sprites have the physics enabled. Then I run the game. The static sprite shows up, but the animated does not. So maybe I misunderstand what is supposed to happen, but I assumed that the animated sprite should show up just like the static sprite. Neither one do anything, I just wanted them displayed. But like I said I may be way off because I have never called a playAnimation().
#3
Try that, so have two animated sprites that should be called. I believe the reason is the container of the staticSprite cannot become animated and vice versa.
::)(
06/29/2011 (7:55 am)
how is your object defined? is it a behaviorField? Not sure that matters, but my main concern is that staticSprites and animatedSprites can not interchange with each other (theory). My advice, would be, create two animatedSprites, however one will APPEAR static. Try that, so have two animated sprites that should be called. I believe the reason is the container of the staticSprite cannot become animated and vice versa.
::)(
#4
Check the console when you run the game in the simulator or on a tethered devices - in xCode ... run->console
Look for any errors.
06/29/2011 (4:40 pm)
Normally a sprite/animated sprite wont show up because it doesn't have the scenegraph attribute i.e. there is no associated scenegraph so it isn't rendered.Check the console when you run the game in the simulator or on a tethered devices - in xCode ... run->console
Look for any errors.
#5
07/01/2011 (2:52 am)
Make sure that the 4-cell-image that the animation uses is above it in the datablock file. I have some vague memories that the animations doesn't work otherwise.
#6
07/01/2011 (9:03 am)
Thanks for the suggestions all, I will check everything out when I get home tonight.
#7
07/01/2011 (10:33 am)
also, make sure that the imageCell datablock is placed in the level datablock before the animation datablock, otherwise, the animation will call for a datablock it can not see.
#8
07/05/2011 (9:17 am)
Thanks all, the problem was(I believe) that the datablocks were not in the correct order. So I'm back in the game! :D
Torque Owner rennie moffat
Renman3000