Changing a Sprite Midgame

I’m working on creating a game where the sprite gets a sword if they are above a certain height. I’ve only got two different sprites I need to switch between and really don’t want to have to make an animation sheet. The code works to switch the sprite but when it switches anything new doesn’t have a collider. Is there a way to add one. If more info is needed I can provide it. The switching code is below.

if (transform.position.y >= 1)
      {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = left;
      }

Hi! What kind of collider component do you have on the GameObject in question? Could you post a screenshot of all the components the GameObject has and also a bit more code surrounding the lines you’ve posted?

This video shows everything (No audio unless I forgot to remove it) Both walls have polygon Colliders and there is nothing else to the code to change sprites other than what I’ve already shared

I see, thank you for posting your video. When you add a PolygonCollider to the GameObject that has a SpriteRenderer attached, Unity automatically sets the PolygonCollider up to (approximately) match the borders of your Sprite.

So, when you first create the object, the shape of the collider is set to the outline of your player character.

What you need to do is update the shape of the PolygonCollider to match the newly displayed character that also has a sword. This thread here suggests a few ways of doing it and seems to be about a very similar situation: