- Home /
Why does my sprite change size when in game but not when in scene?
So I have this 2D platformer game with a ninja sprite for a player. I play the game for a bit, and everything is fine, until my player dies(jumps down a hole, gets hit by an enemy, etc.) Then, when the player respawns, his sprite is about 6 times larger. Not his hitbox, not his transform, but his sprite. I have no way to fix this and nobody else seems to have this problem. Please help!
Please provide the script so that I can help @aristheviking
Answer by FeedMyKids1 · Jun 30, 2020 at 05:10 PM
Try doing the script without parenting your character to any other transforms.
When you parent it and make a change to the localScale, the size change might be different to that made while unparented.
@Kampinkarl1 Well the five transforms it parents are:
Ground Check(so that he cannot double jump and cannot move unless ground check is on the ground)
Fire Point(the transform that the fireballs will be shot from)
Sword(the player's sword that will appear when he attacks)
Center of the Body(so that the script knows when the player is under a one-block space)
Player Health(Notifies the player of the quantity of his heart containers
so I don't know how I am going to get rid of those
I don't mean remove the children from your player. I meant don't parent the character to the $$anonymous$$oving Platform. See if that changes anything as far as sprite size.
It doesn't do anything. I have an explanation with images just below the script on the Google Docs page.
Your answer
Follow this Question
Related Questions
Unity2d Walking off platform throws off gravity 0 Answers
HitBox's Box Collider 2D is not following its parent Enemy sprite 0 Answers
While wall jumping, I'm losing the key down (it seems) in 2D. 0 Answers
Random files from my game folder are gone for no reason 0 Answers
Is there a way to create random polygonal sprite in script? 0 Answers