Skip to main content

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

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.