I am developing a simple platformer, I have three types of tiles right now:
- Floor: does nothing on collision.
- Bad: makes the player lose the game.
- Good: makes the player beat the game.
I am trying to detect the collision with this code I found:
extends RigidBody2D func _process(delta): var tile = get_parent().get_node("TileMap").get_cellv(get_parent().get_node("TileMap").world_to_map(position)) print(tile)
tile variable is supposed to contain the identifier of the type of tile the player is touching, but it doesn't, it always returns -1 (No exception or error, just -1).
I believe returning -1 means it isn't touching any tile, but it is.
This is using Godot 3.0 stable.
What am I missing?
Thank you for your patience.