Changing Player 2D Sprites Back and Forth?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By tjhasan

I want to be able to change the sprite of the player object from one thing to another.

If, for example I have the player’s sprite change into a brick, then change it back to default, I want to be able to have the brick “fall” from the current position of the player.

I’ve been able to do the changing, but can’t seem to spawn a new object like a brick from the player’s current position. Is there a func that accomplishes this?

Everything is done with a 2D Node and movement is done with WASD , 8-way.

:bust_in_silhouette: Reply From: kidscancode

You need to create an instance of the brick scene. Have you read the official tutorial? The enemies are spawned using this method:

Also, see this article for more details about instancing: