Enemy getting inside ground bug

I have an enemy that runs around left and Right and when Player is near the enemy the enemy’s animation changes to attack but during the attack animation the enemy gets inside of the ground can you guys help me fix this?

1 - Your animations can be different resolution and that’s why
2 - Your enemy is on different layer to which player is on and you have different camera settings on both where they should be the same i am talking about center camera on player and zoom

Also am i wrong or is your image of enemy contain A LOT of empty space?

1 Like

I don’t know about the first one but my enemy and player is on the same layer and for camera i used an extension smooth camera

As ZeroX4 mentioned, your attack animation likely has different settings. Since you’ve used other animations, like moving left and right, this issue may come from inconsistent dimensions between animations. To resolve it, open the animation settings in the editor, find the resize option, and make sure all animations have the same width and height. If the dimensions vary, that’s likely causing the animation to randomly shift or appear misaligned. Be sure to click resize and save to apply the changes this should fix the issue!

1 Like

You don’t know? So how about you check?

Look FOR EXAMPLE

Option A
If your object animation images for idle/attack are like 100 x 100
And your walk animation images are 150x150
or 50 x 50
Then you are getting exactly what you have there

Option B
You have A LOT of empty space on your images

Yet your character is NOT centered on same position on all of them
And you get exactly what you have there

Option C
Is option A + option B

So better check it

Bottom line
ALL your animation images for ALL animations
Should be same exact size in pixels
And you should position your character in same space on each image
WHILE you want to have as little as possible empty space

SO your all animation images should take size from image that is biggest
For example idle animation is always small
But attack or run animations tend to be bigger
And so you would adjust size of rest of your images to such biggest animation

1 Like