Game Development Community

Ooops! my Ninja Shrinks when attacking

by AzraelK · in Torque Game Builder · 09/28/2006 (10:08 am) · 3 replies

Im doing my first game in TGB so far so good, enemies hurt my Ninja guy, he moves swiftly I just included an animation where the ninja pulls a sword and does an attack but then the ninja shrinks to half!

What? I understand the original walking animation was smaller than the attack animation (theres no sword when he is just walking about) but why does the ninja shrink to fit that animation size? is there a way to avoid this?

#1
09/28/2006 (10:51 am)
How are your animation datablocks setup? If your walking animation cells are 128x128, and the attack cells are 256x256, then you will probably see the effect you're describing. Either resize the walking animation cells so they're the same size as the attacking cells, or in your code, add in a .setSize("x y") command each time you change animation states.
#2
09/28/2006 (11:49 am)
Thanks Philip that did worked very well, unfortunately is kind of weird since the character is pulled back when the sword is like the game is centering it automatically. how can I keep the character in the same position?
#3
09/28/2006 (1:18 pm)
You have to both reposition and resize. It's a PITA and i hope to get some features in t2dAnimatedSprite to make it do this automatically.