var collisionCounter = get_slide_count() - 1
if collisionCounter > -1:
var col = get_slide_collision(collisionCounter)
if col.collider_id == 1028:
# do something ...
It’s alive !!!
It was my understanding of the docs, I’ve to train that.
Edit : it only work once
After my character is killed, I do an get_tree().reload_current_scene() in the character’s script, and when I want to collide again, it doesn’t work
Thanks a lot !
mister_why | 2018-03-01 04:17
Hi.
That is rare… to kill my character I use myCharacterInScene.queue_free()then I can call get_tree().reload_current_scene() without poblems.
For example, my game scene use a tilemap. In the tilemap scene I have a Area2D with a script and a signal call body_entered. When the character (the character is another scene) enter that area, I call queue_free() and immediately get_tree().reload_current_scene() in the body_entered signal.
Maybe you have some code that you want to take in account when the scene load.
gcivico | 2018-03-01 16:26
Ah !
I was just doing : queue_free() !
How do you get the path of your character ? It’s also an other scene for me.
My tree right now it’s like : World
Player
TileMap
Path2D
StaticBody2D