1 decade ago by HammHetfield
Hi all,
I made a script of a little character with some kind of gun, and the animations of him running.
The size that I would like to collide is 20x54px but each element of the sprite is actually 48x54px due to the shotgun on the side.
so I set the size as follow :
side: {x: 20, y: 54},
Then for my AnimationSheet, I use 48, 54. The problem is that instead of being centered, the image is aligned to the top left corner, making something like that : http://imgur.com/pflBD
The area that collides is "outside" of the image of the character.
Is there a workaround for that ? I know I could use 48x54 but the character would sometimes be walking in the air, it's just impossible to play this way.
Hope there's a solution for that, looking the collision and animation pages of the doc didn't help me.
I made a script of a little character with some kind of gun, and the animations of him running.
The size that I would like to collide is 20x54px but each element of the sprite is actually 48x54px due to the shotgun on the side.
so I set the size as follow :
side: {x: 20, y: 54},
Then for my AnimationSheet, I use 48, 54. The problem is that instead of being centered, the image is aligned to the top left corner, making something like that : http://imgur.com/pflBD
The area that collides is "outside" of the image of the character.
Is there a workaround for that ? I know I could use 48x54 but the character would sometimes be walking in the air, it's just impossible to play this way.
Hope there's a solution for that, looking the collision and animation pages of the doc didn't help me.