0 votes

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.

in Engine by (14 points)

1 Answer

0 votes

You need to create an instance of the brick scene. Have you read the official tutorial? The enemies are spawned using this method:
http://docs.godotengine.org/en/latest/getting_started/step_by_step/your_first_game.html

Also, see this article for more details about instancing:
http://docs.godotengine.org/en/latest/getting_started/step_by_step/instancing.html

by (21,973 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.