Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello, what is happening is that I am trying to get my character to transform himself, that is, to change his appearance, so far I have managed to change his appearance but as soon as he moves, the program is blocked

Hi

Are you changing the appearance with the animation player? You need to be, changing appearance is like changing the sprite it shouldn't block the program.

It would be better if you post your code on the forum and also check any warnings that appear below when it's blocked.

it may help you to look at this and follow, the series is great and will get you back on track.

https://youtu.be/wX145eoLFSM

What happens is that the doll wants it to transform when it touches an object, that I already managed to do. but when it transforms and the player moves the program gets stuck. I have created a kinematicbody2d scene with the new skin and it is the same character and when the power is seized one is erased and the other scene appears and I move there is attached the code of when the other scene is transformed duplicates the same of the skinless player.

func _on_alas_body_entered(body):
if(body.is_in_group("jugador")):
var nuevo_poder = get_tree().get_nodes_in_group("menu_1")[0].poder_alas.instance()
get_tree().get_nodes_in_group("menu_1")[0].add_child(nuevo_poder)
nuevo_poder.global_position = body.global_position
body.queue_free()
queue_free()

(+1)

Hi Thomas

As I said it's hard to answer without all the code, but...

I think the body.queue_free and queue free are the issue.

You are removing a body during a collision with body.queue_free and removing the whole object with queue_free.

I would remove queue_free from your code to start and see if this helps. Using queue_free removes the object and the code, so I'm assuming you don't want to do this.

Hope this helps, any further help needs to be asked in the forum.

All the best.